sckatchof Posted March 25, 2012 Posted March 25, 2012 hi guys i have a small problem when i click start shift i want to back to my job team and skin . when i click start shift skin work but setPlayerTeam dont work server side : function onStartShift () if source then setPlayerTeam ( source, tonumber( getElementData( source, "oldteam" ) ) ) setElementModel ( source, tonumber( getElementData( source, "clothesjob" ) or 0 ) ) outputChatBox( "Test : Start Shift",source,0,0,255 ) end end addEvent("onStartShift",true) addEventHandler("onStartShift", root, onStartShift)
Castillo Posted March 25, 2012 Posted March 25, 2012 function onStartShift ( ) setPlayerTeam ( source, getTeamFromName ( tostring ( getElementData ( source, "oldteam" ) ) ) ) -- You we're converting the data to a number. setElementModel ( source, tonumber ( getElementData ( source, "clothesjob" ) or 0 ) ) outputChatBox( "Test : Start Shift",source, 0, 0, 255 ) end addEvent("onStartShift",true) addEventHandler("onStartShift", root, onStartShift)
sckatchof Posted March 25, 2012 Author Posted March 25, 2012 function onStartShift ( ) setPlayerTeam ( source, tostring ( getElementData ( source, "oldteam" ) ) ) -- You we're converting the data to a number. setElementModel ( source, tonumber ( getElementData ( source, "clothesjob" ) or 0 ) ) outputChatBox( "Test : Start Shift",source, 0, 0, 255 ) end addEvent("onStartShift",true) addEventHandler("onStartShift", root, onStartShift) thank you for help snake and still dont work
Castillo Posted March 25, 2012 Posted March 25, 2012 My bad, I forgot to use getTeamFromName, copy the code again.
sckatchof Posted March 25, 2012 Author Posted March 25, 2012 My bad, I forgot to use getTeamFromName, copy the code again. i copy the code agin and still dont work
Castillo Posted March 25, 2012 Posted March 25, 2012 Start debugging your script then, check if the "oldteam" data exists.
sckatchof Posted March 25, 2012 Author Posted March 25, 2012 Start debugging your script then, check if the "oldteam" data exists. when i open gui setElementData ( localPlayer, "oldteam", getTeamName ( localPlayer ) , true )
drk Posted March 25, 2012 Posted March 25, 2012 'oldteam' data is wrong. setElementData ( localPlayer, 'oldteam', getTeamName ( getPlayerTeam ( localPlayer ) ), true )
sckatchof Posted March 25, 2012 Author Posted March 25, 2012 'oldteam' data is wrong. setElementData ( localPlayer, 'oldteam', getTeamName ( getPlayerTeam ( localPlayer ) ), true ) thank you Draken work
yMassai Posted March 25, 2012 Posted March 25, 2012 this case would be the team would know but let me know how Faso to get a skin?
drk Posted March 25, 2012 Posted March 25, 2012 Can you explain in a proper English? I can't understand nothing.
yMassai Posted March 25, 2012 Posted March 25, 2012 sorry friend I would like to know how to get a skin. this case the player get a Team, you can would tell me how to get a skin and a team?
CapY Posted March 25, 2012 Posted March 25, 2012 EDIT: Kenix was faster sorry friendI would like to know how to get a skin. this case the player get a Team, you can would tell me how to get a skin and a team? To get player's skin, use: getElementModel for team: getPlayerTeam
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