sckatchof Posted March 24, 2012 Share Posted March 24, 2012 hi guys i have make a clothes shop but when i worked in other work the skin change to skin job like police job and i want when i do /criminal my skin change to when i buy skin from clothes shop server side : criminalTeam = createTeam ("Criminal", 255, 0, 0) function joinTeam (thePlayer) setPlayerTeam ( thePlayer, criminalTeam ) setElementModel ( thePlayer, tonumber( getElementData( thePlayer, "clothesSkin" ) ) outputChatBox ( "You are now a criminal.",source, 0, 255, 0 ) end addCommandHandler ("criminal", joinTeam) Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 (edited) uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) function fJoinTeam ( uPlayer ) setPlayerTeam ( uPlayer, uCriminalTeam ) setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) ) outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) end addCommandHandler ( 'criminal', fJoinTeam ) You forgot close function and in line 6 source is not defined. Predefined variable source used only in function handler event. Edited March 24, 2012 by Guest Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) function fJoinTeam ( uPlayer ) setPlayerTeam ( uPlayer, uCriminalTeam ) setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) ) outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) end addCommandHandler ( 'criminal', fJoinTeam ) You forgot close function and in line 6 source is not defined. thnx for help but still dont work Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 (edited) Show meta.xml Edited March 24, 2012 by Guest Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 /debugscript 3? Bad argument @ setElementModel Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 (edited) uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) function fJoinTeam ( uPlayer ) setPlayerTeam ( uPlayer, uCriminalTeam ) setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) or 0 ) ) outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) end addCommandHandler ( 'criminal', fJoinTeam ) Your data 'clothesSkin' not have value. Edited March 24, 2012 by Guest Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 Some problem . @setElementModel Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 (edited) uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) function fJoinTeam ( uPlayer ) setPlayerTeam ( uPlayer, uCriminalTeam ) outputChatBox( '->' .. tostring( getElementData( uPlayer, 'clothesSkin' ) ) ) setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) ) or 0 ) outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) end addCommandHandler ( 'criminal', fJoinTeam ) Debug it. I think your data 'clothesSkin' not defined. Edited March 24, 2012 by Guest Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 uCriminalTeam = createTeam ( 'Criminal', 255, 0, 0 ) function fJoinTeam ( uPlayer ) setPlayerTeam ( uPlayer, uCriminalTeam ) outputChatBox( 'type' .. type( getElementData( uPlayer, 'clothesSkin' ) ) ) assert( type( getElementData( uPlayer, 'clothesSkin' ) ) == 'number' ) setElementModel ( uPlayer, tonumber( getElementData( uPlayer, 'clothesSkin' ) or 0 ) ) outputChatBox ( 'You are now a criminal.', uPlayer, 0, 255, 0 ) end addCommandHandler ( 'criminal', fJoinTeam ) Debug it. I think your data 'clothesSkin' not defined. output : typestring debugscript 3 : Error line 6 : assertion failed! Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 I update code. know when i do /criminal skin change to CJ skin . Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 I know.What output in chat? out put : -> Farm-Town inhabitant 2 Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 Ah It's incorrect you need use in 3 argument ( setElementData ) numbers or string with numbers. Where you set this data? Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 Ah It's incorrect you need use in 3 argument ( setElementData ) numbers or string with numbers. Where you set this data? in clothes shop .. .. setElementData ( source, "clothesSkin", finalskin, true ) ... Link to comment
sckatchof Posted March 24, 2012 Author Share Posted March 24, 2012 Ah It's incorrect you need use in 3 argument ( setElementData ) numbers or string with numbers. Where you set this data? thank youuuuuuuuuu kenix work 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