d43dr4 Posted December 10, 2012 Posted December 10, 2012 Hello Guys, ^^ How r yah ? i have a code to set player stats, it works when i set just one stat buy if i set too many stats the script stop working The code which works : function changeBodyStrength ( player, commandName ) if ( setPlayerStat ( player, 24, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) end end addCommandHandler ( "xx", changeBodyStrength ) The code which not works : ( Cuz i set many stats ) function changeBodyStrength ( player, commandName ) if ( setPlayerStat ( player, 22, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 23, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 24, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 69, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 70, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 71, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 72, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 73, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 74, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 75, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 76, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 77, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 78, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) elseif ( setPlayerStat ( player, 79, 999 ) ) then outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) end end addCommandHandler ( "xx", changeBodyStrength ) i hope you correct this script please ... Just Smile !
Castillo Posted December 10, 2012 Posted December 10, 2012 stats = { 22, 23, 24, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 } function changeBodyStrength ( player ) for _, stat in ipairs ( stats ) do setPedStat ( player, stat, 999 ) end outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) end addCommandHandler ( "xx", changeBodyStrength ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 Thx Castillo Works great ^^ Just Smile !
Castillo Posted December 10, 2012 Posted December 10, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 but how to make the chat output by color ? please and how to make in place of type xx auto when its found my name i mean in place of type xx, the stats sets to me automaticly when it found my name : #[iMr][E'rrOr]_N Just Smile !
Castillo Posted December 10, 2012 Posted December 10, 2012 I guess you mean when a player with that name joins, if so, then you can use: onPlayerJoin getPlayerName string.find San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 what about the output color ? Just Smile !
AhmadQTR Posted December 10, 2012 Posted December 10, 2012 what about the output color ? outputChatBox ( "Hernandez", root, 255, 100, 0, true ) true for r g b colors Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
d43dr4 Posted December 10, 2012 Author Posted December 10, 2012 Thx guys ... always you resoulve the problems, i have learn many things !! mybe i will be like you in the few weeks ^^ Just Smile !
AhmadQTR Posted December 11, 2012 Posted December 11, 2012 Thx guys ...always you resoulve the problems, i have learn many things !! mybe i will be like you in the few weeks ^^ You're Welcome , i'm still learning too Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
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