Jump to content

bamby12

Members
  • Posts

    61
  • Joined

  • Last visited

bamby12's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. Ok i made a GUI and put a gridlist in, i want the gridlist to show all the players from the players current team how would i go about this?
  2. Thank you for fixing the problem JR10 !
  3. Can anyone tell me why i get error from this cant seem to see it? addEvent("createGang", true) addEventHandler("createGang", getRootElement(), create )
  4. yeah thats exactly what i meant to say but still i cant see why the save don't work Thanks for the 6 hours of pain and suffering on notepad++ last night Citizen much appreciated now it works
  5. NVM it works now thanks, how can i save element data though? i tried: function outbreak() local account = getPlayerAccount(source) if (account) then local doob = getAccountData( source, "Experience" ) local doob2 = getAccountData( source, "Level") if (doob) then setElementData ( source, "Experience", tonumber(doob) ) setElementData ( source, "Level", tonumber(doob2) ) else setElementData ( source, "Experience", 0 ) setElementData ( source, "Level", 0 ) end end end addEventHandler("onPlayerLogin", getRootElement(), outbreak) function quit() local account = getPlayerAccount(source) if (account) then local Experience = getElementData(source,"Experience") local Level = getElementData(source,"Level",Level) setAccountData(source,"Experience", Experience) setAccountData (source,"Level",Level) end end addEventHandler("onPlayerQuit", getRootElement(),quit)
  6. yeah didnt see u was online though pm me please
  7. i tried this but it still dosnt show up
  8. ok im trying to make a dx level system and it dosent work and i cant understand why it wont even show up anymore Client: function experience() GUIEditor_Label = {} local level = getElementData(source,"Level:") if (level) then GUIEditor_Label[1] = guiCreateLabel(266,696,197,21,"Level:"..level,false) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) else setElementData(source,"Level:", 1) local lvl = getElementData(source,"Level:") GUIEditor_Label[1] = guiCreateLabel(266,696,197,21,"Level:"..lvl,false) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) end local Experience = getElementData(source,"Experience:") if (Experience) then GUIEditor_Label[2] = guiCreateLabel(265,724,199,21,"Experience:"..Experience,false) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) else setElementData(source,"Experience", 1) local Experience = getElementData(source,"Experience:") GUIEditor_Label[2] = guiCreateLabel(265,724,199,21,"Experience:"..Experience,false) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) end end addEventHandler("onClientResourceStart", getRootElement(), experience) -- Direct X Drawing addEventHandler("onClientRender",root, function() dxDrawRectangle(263.0,722.0,205.0,27.0,tocolor(0,0,0,170),false) dxDrawRectangle(263.0,694.0,205.0,27.0,tocolor(0,0,0,170),false) end ) addEventHandler ( "onClientElementDataChange", root, function ( dataName, player ) local XP = getElementData(getLocalPlayer(),"Experience:") guiSetText ( GUIEditor_Label[2], "Experience:"..XP) guiSetVisible ( GUIEditor_Label[2], true ) local level = getElementData(getLocalPlayer(),"Level:") guiSetText ( GUIEditor_Label[1], "Level:"..level) guiSetVisible ( GUIEditor_label[1], true ) end end) Server: function outbreak(player) local account = getPlayerAccount(player) if (account) then local doob = getAccountData( player, "Experience:" ) local doob2 = getAccountData( player, "Level:") if (doob) then setElementData ( player, "Experience:", doob ) setElementData ( player, "Level:", doob2 ) else setElementData ( player, "Experience:", 0 ) setElementData ( player, "Level:", 0 ) end end end addEventHandler("onPlayerLogin", getRootElement(), outbreak) addEventHandler("onPlayerQuit", getRootElement(),quit) function quit(Player) local account = getPlayerAccount(Player) if (account) then local Experience = getElementData(Player,"Experience:") local Level = getElementData(Player,"Level:",Level) setAccountData(Player,"Experience:", Experience) setAccountData (Player,"Level:",Level) end end addEventHandler("onElementDataChange",getRootElement(),levelup) function levelup(Player) local XP = getElementData(Player,"Experience:") if XP == 25 then setElementData ( Player, "Level:", 2) outputChatBox ( Player, "You Are Now Level 2!", 0,255,0) end if XP == 75 then setElementData ( Player, "Level:", 3) outputChatBox ( Player, "You Are Now Level 3!", 0,255,0) end if XP == 150 then setElementData ( Player, "Level:", 4) outputChatBox ( Player, "You Are Now Level 4!", 0,255,0) end if XP == 300 then setElementData ( Player, "Level:", 5) outputChatBox ( Player, "You Are Now Level 5!", 0,255,0) end if XP == 425 then setElementData ( Player, "Level:", 6) outputChatBox ( Player, "You Are Now Level 6!", 0,255,0) end if XP == 650 then setElementData ( Player, "Level:", 7) outputChatBox ( Player, "You Are Now Level 7!", 0,255,0) end end function deanimated (ammo, attacker, weapon, bodypart) if (attacker) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then if (getElementData (source, "zombie") == true) then local XP = getElementData ( attacker, "Experience:" ) if XP ~= false then setElementData ( attacker, "Experience:", XP+math.random(2,5)) else setElementData ( attacker, "Experience:", 1 ) end end end end end addEventHandler("onPedWasted", resourceRoot, deanimated) any help appreciated thanks.
  9. Hi i want to make a level system, i made the gui and stuff and i can make the "experience" work but how can i make it so that when the element data "experience" gets to a certain number that it will +1 on the level? any help appreciated
  10. sorry ignore my other post i didn't read it properly, if the script proracer put was right then i think to make the command would be: function myCash ( thePlayer ) local cash = getElementData ( thePlayer, "data.cash" ) --sorry my bad i put source instead of thePlayer outputChatBox ( "Your cash is: " .. tostring ( cash ), thePlayer ) end addCommandHandler ( "cash", myCash ) edited from The Kid, maybe im wrong.
  11. i don't think this will work in race because the race game mode will spawn your player at the start of the race and the maps change all the time so you could spawn your player outside of the map if you get what im trying to explain, in other words if you do manage to get this to work then say i join your server on map A and logout then it will save my position and then if map B started then ill spawn in the same place where i was on map A and i would be out of the race. theres probably another way to do this but i don't know how you would do it whilst the maps are changing sorry.
  12. what functions could i use to make a volcano script something like a col shape that has objects floating round it but how would i make the objects float? also would it be easier to create a volcano and what functions would i need to do that instead?
  13. in the next version of MTA could you make it so we can expand the server console please and also enable scrolling on it maybe? so we can go back and see what has happened on the sever and what not.
×
×
  • Create New...