Jump to content

check


Recommended Posts

Posted

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) 

Posted

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) 
Posted

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

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

Posted
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?

Posted
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

Posted

Can you tell us what are you trying to do? Just as TAPL said "Why are you using an element data whereas you can simply use:

doesPedHaveJetPack 

? "

Posted

He wants to check or the player is using the Jetpack for the first time. If so, then give an achievement. If not, do nothing. You will have to store it somewhere, you know?

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