d43dr4 Posted December 10, 2012 Share 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 ... Link to comment
Castillo Posted December 10, 2012 Share 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 ) Link to comment
d43dr4 Posted December 10, 2012 Author Share Posted December 10, 2012 Thx Castillo Works great ^^ Link to comment
d43dr4 Posted December 10, 2012 Author Share 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 Link to comment
Castillo Posted December 10, 2012 Share 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 Link to comment
d43dr4 Posted December 10, 2012 Author Share Posted December 10, 2012 what about the output color ? Link to comment
AhmadQTR Posted December 10, 2012 Share Posted December 10, 2012 what about the output color ? outputChatBox ( "Hernandez", root, 255, 100, 0, true ) true for r g b colors Link to comment
d43dr4 Posted December 10, 2012 Author Share 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 ^^ Link to comment
AhmadQTR Posted December 11, 2012 Share 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 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