Cyandie Posted June 10, 2012 Share Posted June 10, 2012 Okay so I have this script server sided and it won't put me in the team when i type in /criminal here is my code function setTeamCriminal( thePlayer ) setPlayerTeam(thePlayer, "Criminals") end addCommandHandler("criminal", setTeamCriminal) Link to comment
Al3grab Posted June 10, 2012 Share Posted June 10, 2012 the 2nd argument should be a team element so use the function 'getTeamFromName' Link to comment
Cyandie Posted June 10, 2012 Author Share Posted June 10, 2012 So like this? function setTeamCriminal( thePlayer ) local criminalteam = getTeamFromName ( "Criminals" ) setPlayerTeam(thePlayer, criminalteam) end addCommandHandler("criminal", setTeamCriminal) ? Link to comment
X-SHADOW Posted June 10, 2012 Share Posted June 10, 2012 Server-Side function what () local why = createTeam ('Criminals') if ( why ) then local go = getTeamFromName( 'Criminals') if ( go ) then setPlayerTeam( source, go ) outputChatBox('You Are Now Criminal ',source,255,255,0) end end end addCommandHandler("criminal", what) Link to comment
Cyandie Posted June 10, 2012 Author Share Posted June 10, 2012 @ Al3grab Worked thanks Link to comment
Alex. Posted June 10, 2012 Share Posted June 10, 2012 (edited) Server-Side function what () local why = createTeam ('Criminals') if ( why ) then local go = getTeamFromName( 'Criminals') if ( go ) then setPlayerTeam( source, go ) outputChatBox('You Are Now Criminal ',source,255,255,0) end end end addCommandHandler("criminal", what) What the fuck? That is a giant mess. Neither is it was the topic starter asked for. If he would like to do it your way I would recommend: local crimTeam = createTeam("Criminals") function setTeam(tPlayer) setPlayerTeam(tPlayer, crimTeam) outputChatBox("You Are Now Criminal", tPlayer, 255, 255, 0) end addCommandHandler("criminal", setTeam) Edited June 10, 2012 by Guest Link to comment
Cyandie Posted June 10, 2012 Author Share Posted June 10, 2012 That code is a big mess to be honest and not very stable. 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