Jump to content

Stevenn

Members
  • Posts

    97
  • Joined

  • Last visited

Posts 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. 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

  3. 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

  4. one last thing then I'm done ( I think xD)

    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?

    :D

  5. 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..

  6. 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 ) 
      
    

    :idea:

  7. 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" )  
    

  8. 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.

  9. 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"

  10. 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 
    

  11. Yes.

    But you have mistake with this

      
    sellerped = createPed ( 1, t.x, t.y, t.z, "cylinder", 2, 250,250,250 ) 
        setElementRotation ( serllerped, t.rotX, t.rotY, t.rotZ ) -- sellerped not defined 
      
    

    And you should use

    setPedRotation 
    

    instead of

    setElementRotation 
    

    i changed serllerped to sellerpad as it was a typo, although its still the same error!

  12. 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 
    

    ??

×
×
  • Create New...