DaemonHunter Posted July 17, 2012 Posted July 17, 2012 hi guys is this codee correct? local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( thePlayer ) ) ) if (gang == "SWAT" ) then setPedStat ( ped thePed, int 24, float 200 ) ROAD community
TAPL Posted July 17, 2012 Posted July 17, 2012 setPedStat ( ped thePed, int 24, float 200 ) should be setPedStat ( thePlayer, 24, 999 )
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 so it must be like this one? local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( thePlayer ) ) ) if (gang == "SWAT" ) then setPedStat ( thePlayer, 24, 999 ) ROAD community
TAPL Posted July 17, 2012 Posted July 17, 2012 why you don't test it and tell us the result? i am not sure about the argument 'thePlayer' because you didn't show the entire code.
rolling11 Posted July 17, 2012 Posted July 17, 2012 why you don't test it and tell us the result?i am not sure about the argument 'thePlayer' because you didn't show the entire code. why dont you just help the guy , if you cant dont post
Anderl Posted July 17, 2012 Posted July 17, 2012 why you don't test it and tell us the result?i am not sure about the argument 'thePlayer' because you didn't show the entire code. why dont you just help the guy , if you cant dont post He already helped, read before post these type of things. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 why you don't test it and tell us the result?i am not sure about the argument 'thePlayer' because you didn't show the entire code. why dont you just help the guy , if you cant dont post He already helped, read before post these type of things. He hlped me a lot. but i didnt understnd the sentence: "because you didn't show the entire code" this is the entire code ROAD community
Wei Posted July 17, 2012 Posted July 17, 2012 for _, thePlayer in ipairs (getElementsByType("player")) do local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( thePlayer ) ) ) if (gang == "SWAT" ) then setPedStat ( thePlayer , 24, 200 ) end end Maybe this will work Diet with russian vodka, lose 3 days in one week !
TAPL Posted July 17, 2012 Posted July 17, 2012 why you don't test it and tell us the result?i am not sure about the argument 'thePlayer' because you didn't show the entire code. why dont you just help the guy , if you cant dont post STFU. blazy@ i think he need it with event onPlayerSpawn.
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 why you don't test it and tell us the result?i am not sure about the argument 'thePlayer' because you didn't show the entire code. why dont you just help the guy , if you cant dont post STFU. blazy@ i think he need it with event onPlayerSpawn. what is the difference? ROAD community
Castillo Posted July 17, 2012 Posted July 17, 2012 Well, that script will set all online players of that gang stat, but not the players that may connect later. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 Well, that script will set all online players of that gang stat, but not the players that may connect later. how can I fix it? ROAD community
Castillo Posted July 17, 2012 Posted July 17, 2012 Use the event: onPlayerSpawn instead. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 for _, thePlayer in ipairs (getElementsByType("player")) do local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( thePlayer ) ) ) if (gang == "SWAT" ) then setPedStat ( onPlayerSpawn , 24, 200 ) end end do you mean something like this? ROAD community
TAPL Posted July 17, 2012 Posted July 17, 2012 for _, thePlayer in ipairs (getElementsByType("player")) do local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( thePlayer ) ) ) if (gang == "SWAT" ) then setPedStat ( onPlayerSpawn , 24, 200 ) end end do you mean something like this?
DaemonHunter Posted July 17, 2012 Author Posted July 17, 2012 what is the problem now? I was only asking if it is correct... ROAD community
Castillo Posted July 17, 2012 Posted July 17, 2012 What can I say without being rude... is all wrong, you should learn about event system and Lua basics. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Al3grab Posted July 17, 2012 Posted July 17, 2012 This is how it works .. function myFunc ( ) -- create the function -- add your code end -- close the function addEventHandler("onPlayerSpawn",getRootElement(),myFunc) -- Link the function with the event ING : [xXx]~Al3grab
GTX Posted July 17, 2012 Posted July 17, 2012 function func() local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( source ) ) ) if (gang == "SWAT" ) then setPedStat ( source, 24, 200 ) end end addEventHandler("onPlayerSpawn", root, func) Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
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