Jump to content

setPlayerTeam


SkatCh

Recommended Posts

Hi,

please can anyone fix this for me :

i don't know maybe it's correct because i didn't test it .

_setPlayerTeam = setPlayerTeam 
function setPlayerTeam(player, team) 
    if (not isElement(player)) then return end 
    local oldTeam = getPlayerTeam(player) 
    if (oldTeam) then oldTeam = getTeamName(oldTeam) end 
    local team = getTeamFromName(team) 
    if (team) then 
        _setPlayerTeam(player, team) 
        triggerEvent("onPlayerChangeTeam", player, oldTeam, getTeamName(team)) 
    end 
end 

Link to comment

Mate what's _setPlayerTeam?...

Where's the name of the function?

where is the Eventhandler or CommandHabler? ofc it will not work due to these errors.

Too You should create a team, because you are using team as variable and it's not you should use the team that you create as variable, good luck!

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