sckatchof Posted March 25, 2012 Share 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) Link to comment
Castillo Posted March 25, 2012 Share 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) Link to comment
sckatchof Posted March 25, 2012 Author Share 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 Link to comment
Castillo Posted March 25, 2012 Share Posted March 25, 2012 My bad, I forgot to use getTeamFromName, copy the code again. Link to comment
sckatchof Posted March 25, 2012 Author Share Posted March 25, 2012 My bad, I forgot to use getTeamFromName, copy the code again. i copy the code agin and still dont work Link to comment
Castillo Posted March 25, 2012 Share Posted March 25, 2012 Start debugging your script then, check if the "oldteam" data exists. Link to comment
sckatchof Posted March 25, 2012 Author Share 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 ) Link to comment
drk Posted March 25, 2012 Share Posted March 25, 2012 'oldteam' data is wrong. setElementData ( localPlayer, 'oldteam', getTeamName ( getPlayerTeam ( localPlayer ) ), true ) Link to comment
sckatchof Posted March 25, 2012 Author Share Posted March 25, 2012 'oldteam' data is wrong. setElementData ( localPlayer, 'oldteam', getTeamName ( getPlayerTeam ( localPlayer ) ), true ) thank you Draken work Link to comment
yMassai Posted March 25, 2012 Share Posted March 25, 2012 this case would be the team would know but let me know how Faso to get a skin? Link to comment
drk Posted March 25, 2012 Share Posted March 25, 2012 Can you explain in a proper English? I can't understand nothing. Link to comment
yMassai Posted March 25, 2012 Share 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? Link to comment
Kenix Posted March 25, 2012 Share Posted March 25, 2012 getElementModel getPlayerTeam Link to comment
CapY Posted March 25, 2012 Share 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 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