Jump to content

Stevenn

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by Stevenn

  1. Hello, i got another problem, if I click on a button, it wont trigger my event and I have no idea.. function buttonClick( button) if (button) ~= "left" then return end if ( source == lol ) then showCursor ( false ) elseif ( source == button ) then triggerEvent ( "MyEvent", localPlayer ) end end addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true)
  2. Hey, how can I check if two edits has the same text/value ?
  3. @Jay I created the label in the GUI function. And it works now, thanks!
  4. function kills () local nData = tonumber( getElementData ( localPlayer, 'kills' ) or 0 ) if nData > 0 and nData <50 then guiSetText ( killLabel, "Kills: "..getElementData (localPlayer, "kills") ) elseif nData > 50 and nData < 115 then guiSetText ( killLabel, "Kills: "..getElementData (localPlayer, "kills") ) end end addEventHandler ( "onClientResourceStart", root, kills ) setTimer ( kills, 1000, 1 ) It doesn't work, if I get a new point, nothing happens until i restart the resource. Shouldn't be on any event, should be updated even if I set my element data using the admin panel
  5. Isn't it just possible to update the function which I use to set the guiText ? In this case: function rank ()
  6. Okay so, if I kill a player I will get one point which will then be showed on a label. but, if I kill another player I have to restart the resource in order to update the label
  7. one last thing then I'm done ( I think ) if I change my element data, I have to restart the resource for it to update my label, how can I add a timer or something?
  8. Omg, I love you thanks kenix!
  9. Example: If I have 0-50 points it will do something, but if I have 50-115 it will do something different, and then if I have 115-500 it will do different and so on..
  10. Okay, thanks but how can I do something like this: function rank () if tonumber( getElementData ( localPlayer, "rank" ) ) < 50 then outputChatBox ( "502" ) elseif tonumber( getElementData ( localPlayer, "rank" ) ) < 50-115 then -- i know its wrong, but I have no idea.. end addEventHandler ( "onClientResourceStart", root, rank )
  11. "Attempted to compare string with number"
  12. Hello, i have a question. How can I check if I have my element data below 50 like: -- lets say my element data is 23 which is below 50, it should do this: if getElementData ( localPlayer, "rank" ) ~= 0-50 then outputChatBox ( "hey" )
  13. Stevenn

    on ground?

    yea, forgot to say I solved it using: isPedOnGround
  14. Stevenn

    on ground?

    hello, i wonder how i can trigger an event only if the player is on the ground. so if im in a chopper hovering above a marker, nothing will happen until i land on it.
  15. I had a typo, fixed now. But if I want it to update my level every now and then, how would I do that? I know its with a timer, but I'm not so god with timers!
  16. guiSetText ( rankLabel, "Rank: " ..getElementData (localPlayer, "Rank") ) doesn't work..
  17. I clearly said WITHOUT, please stop post hunting !
  18. thank you, can i use setElementData without adding a column on scoreboard?
  19. Hello. I need some help. If I want to increase someones element data, like different levels how can I do that? function lol () setElementData ( source, "Rank", +1 ) end or something?
  20. Hello, I got a quuestion, when a player connects to my server for the first time, a GUI should be drawed, but I don't know what the event is named or don't i need an event
  21. Stevenn

    onMarkerHit

    Hello, i got a problem.. i got this code: local tMarkers = { { nX = 0, nY = 0, nZ = 10 }; { nX = 200, nY = 200, nZ = 20 }; } for _, t in pairs( tMarkers ) do lolMarkers = createMarker ( t.nX, t.nY, t.nZ ) end function myfunction () triggerClientEvent ( "myevent", source ) end addEventHandler ( "onMarkerHit", lolMarkers, myfunction) but I get bad argument at "addEventHandler ( "onMarkerHit", lolMarkers, myfunction"
  22. I can't understand what you mean with not defined.. i tried local sellerPeds = { { nX = 0, nY = 0, nZ = 10 }; { x = -1539, y = 126, z = 3, rotX = 0, rotY = 0, rotZ = 0 }; } for _, t in pairs( sellerPeds ) do local sell = createPed ( 1, t.x, t.y, t.z ) setPedRotation ( sell, t.rotX, t.rotY, t.rotZ ) -- sellerped not defined end
  23. i changed serllerped to sellerpad as it was a typo, although its still the same error!
  24. okay thanks, it works but if i want to change it to peds and i want to set the rotation? local sellerPeds = { { nX = 0, nY = 0, nZ = 10 }; { x = -1539, y = 126, z = 3, rotX = 0, rotY = 0, rotZ = 0 }; } for _, t in pairs( sellerPeds ) do sellerped = createPed ( 1, t.x, t.y, t.z, "cylinder", 2, 250,250,250 ) setElementRotation ( serllerped, t.rotX, t.rotY, t.rotZ ) end ??
  25. hey, how can i create markers from a table? like markers = { {x,y,z}; {x,y,z}; } createMarker ( makers, blablabla )
×
×
  • Create New...