Negriukas Posted July 28, 2014 Share Posted July 28, 2014 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
AboShanab Posted July 28, 2014 Share Posted July 28, 2014 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
TAPL Posted July 28, 2014 Share Posted July 28, 2014 What the point of the element data when you already have the function doesPedHaveJetPack available client and server side? Link to comment
Negriukas Posted July 28, 2014 Author Share Posted July 28, 2014 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.. Link to comment
Controlled Posted July 28, 2014 Share Posted July 28, 2014 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
Et-win Posted July 28, 2014 Share Posted July 28, 2014 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 Link to comment
Saml1er Posted July 28, 2014 Share Posted July 28, 2014 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 ? " Link to comment
Et-win Posted July 28, 2014 Share Posted July 28, 2014 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? Link to comment
-.Paradox.- Posted July 29, 2014 Share Posted July 29, 2014 Use getAccountData to see if he use the jetpack for first time if not then set his AccountData to first time else nothing as far as i know Link to comment
Addlibs Posted August 2, 2014 Share Posted August 2, 2014 Just do a check whether they were given the achievement before, if not - give it Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now