Jump to content

createPlayerTeam not working


Recommended Posts

Hello guys im try to make a script which is creating a Team ,but its not working.

function newTeam( source, TeamName ) 
    theGMTEAM = createTeam("GM TEAM") 
    if theGMTEAM then 
        setPlayerTeam(source, theGMTEAM) 
    end 
end 
addCommandHandler("st", newTeam) 

line 2 attempt to call global createTeam(nil value)

How can i fix it ?

Link to comment

Try this:

  
function newTeam( source, command, teamName ) 
    if teamName then 
        createTeam(teamName) 
        local myTeam = getTeamFromName(teamName) 
        if (myTeam ~= nil) then 
            setPlayerTeam(source, myTeam) 
        end 
   end 
end 
addCommandHandler("st", newTeam) 
  

BUT this function is /st GM TEAM, you choose your own name for the team.

Link to comment
Yeah b'coz Luka doesn't know what he is commenting just like what he is doing on my posts. Try my script it should work fine.

What's your problem pal, why do you have to be so immature?

Are you sure that you're typing the command correctly? Like I said, you must type /st GM TEAM

Link to comment
  
function createGMTEAM(source) 
ex = createTeam("GM TEAM") 
setPlayerTeam(source,ex) 
end 
addCommandHandler("gm",createGMTEAM) 
  

You should type /gm on *T* chat and this will create a GM TEAM and automatically puts you in that team.

Other is like

  
ex = createTeam("GM TEAM") 
function makemeGM(source) 
setPlayerTeam(source,ex) 
end 
addCommandHandler("gm",makemeGM) 
  

2nd script the GM TEAM is already created and you just have to type /gm in *T* chat to get you on that team.

Link to comment

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...