sckatchof Posted March 24, 2012 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)
Kenix Posted March 24, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author 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
Kenix Posted March 24, 2012 Posted March 24, 2012 (edited) Show meta.xml Edited March 24, 2012 by Guest http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Kenix Posted March 24, 2012 Posted March 24, 2012 /debugscript 3? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author Posted March 24, 2012 /debugscript 3? Bad argument @ setElementModel
Kenix Posted March 24, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Kenix Posted March 24, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author 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!
Kenix Posted March 24, 2012 Posted March 24, 2012 I update code. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author Posted March 24, 2012 I update code. know when i do /criminal skin change to CJ skin .
Kenix Posted March 24, 2012 Posted March 24, 2012 I know. What output in chat? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author Posted March 24, 2012 I know.What output in chat? out put : -> Farm-Town inhabitant 2
Kenix Posted March 24, 2012 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? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
sckatchof Posted March 24, 2012 Author 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 ) ...
sckatchof Posted March 24, 2012 Author 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
Kenix Posted March 24, 2012 Posted March 24, 2012 No problem. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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