Jump to content

Setting Teams Error


Cyandie

Recommended Posts

Posted

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) 

Posted

So like this?

function setTeamCriminal( thePlayer ) 
    local criminalteam = getTeamFromName ( "Criminals" ) 
    setPlayerTeam(thePlayer, criminalteam) 
end 
addCommandHandler("criminal", setTeamCriminal) 

?

Posted

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) 

Posted (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 by Guest

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...