Jump to content

check


Recommended Posts

Hello guys, I made a script to set Player element data "Jetpack" true if he have a jetpack otherwise False but not working, here is my code.

Server:

function checkWhoHaveJetpack() 
for index, thePlayer in ipairs(getElementsByType("player"))do 
    if doesPedHaveJetPack(thePlayer) then 
        setElementData(thePlayer, "Jetpack", "Jetpack") 
    end 
end 
end 
setTimer(checkWhoHaveJetpack, 1000, 0) 

Link to comment

Try This.

function checkWhoHaveJetpack() 
    for index, thePlayer in ipairs(getElementsByType("player"))do 
        if doesPedHaveJetPack(thePlayer) then 
            setElementData(thePlayer, "Jetpack", true) 
        else 
            setElementData(thePlayer, "Jetpack", false) 
        end 
    end 
end 
setTimer(checkWhoHaveJetpack, 1000, 0) 
Link to comment
What the point of the element data when you already have the function doesPedHaveJetPack available client and server side?

I made an achievement system, and i'm trying to give the player an award after first time using jetpack..

  
    function checkWhoHaveJetpack() 
        for index, thePlayer in ipairs(getElementsByType("player"))do 
            if doesPedHaveJetPack(thePlayer) then 
                -- Trigger Achievement 
            end 
        end 
    end 
    setTimer(checkWhoHaveJetpack, 1000, 0) 

lol?

Link to comment
What the point of the element data when you already have the function doesPedHaveJetPack available client and server side?

I made an achievement system, and i'm trying to give the player an award after first time using jetpack..

  
    function checkWhoHaveJetpack() 
        for index, thePlayer in ipairs(getElementsByType("player"))do 
            if doesPedHaveJetPack(thePlayer) then 
                -- Trigger Achievement 
            end 
        end 
    end 
    setTimer(checkWhoHaveJetpack, 1000, 0) 

lol?

Does this check or you have it for the first time? No. So shhh :P

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...