toptional Posted May 15, 2013 Share Posted May 15, 2013 I have a slight issue, I get a bad argument for setPlayerTeam when the person does /criminal, another issue is who ever does /criminal the chat appears to everyone (This is all server side) On another script the team is created local Criminals = createTeam ("Criminals",220,0,0) Here is a different script where /criminal is made but not working D: function setCriminal () if not Criminals then setPlayerTeam (source,Criminals) outputChatBox ("You are now a Criminal!",source,255,0,0) else outputChatBox ("You are already a Criminal!",source,255,0,0) end end addCommandHandler("criminal",setCriminal) Link to comment
TAPL Posted May 15, 2013 Share Posted May 15, 2013 You will need to use getTeamFromName to get the team from another script. Also source is not defined. if not Criminals then And this is wrong, you should get the player team using getPlayerTeam and compare it to the team element after getting it with getTeamFromName. Link to comment
toptional Posted May 15, 2013 Author Share Posted May 15, 2013 How about this? --/criminal function setCriminal () getPlayerTeam ( source ) = gotTeam if gotTeam == Criminals then outputChatBox ("You are already a Criminal!",source,255,0,0) else setPlayerTeam (source,getTeamFromName(tostring(Criminals))) outputChatBox ("You are now a Criminal!",source,255,0,0) end end addCommandHandler("criminal",setCriminal) Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 -- # Server Side function setCriminal ( player ) if getPlayerTeam ( player ) == getTeamFromName ( "Criminals" ) then outputChatBox ("You are already a Criminal!",player,255,0,0) return end setPlayerTeam (player,getTeamFromName( "Criminals" ) ) outputChatBox ("You are now a Criminal!",player,255,0,0) end addCommandHandler("criminal",setCriminal) Link to comment
toptional Posted May 15, 2013 Author Share Posted May 15, 2013 Thank you Mr.Pres[T]ege! Your a great helper 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