Jump to content

team


Amine#TN

Recommended Posts

  • Administrators
function joinUnem()
  if not getPlayerTeam(source) then
    setPlayerTeam(source,getTeamFromName("Civil"))
  end
end
addEventHandler("onPlayerLogin",getRootElement(),joinUnem)

 

Edited by LopSided_
Link to comment

Try this, it should work.

local team = createTeam("Civil", 0, 0, 0) -- Create the team, (0, 0, 0) Change the team color if you want.



addEventHandler("onPlayerLogin", getRootElement(),
function ()
        setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on player Join.
end)
Edited by TorNix~|nR
Link to comment
10 minutes ago, TorNix~|nR said:

Try this, it should work.


local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want



addEventHandler("onPlayerLogin", getRootElement(),
function ()
        setPlayerTeam(source, getTeamFromName("Civil")) -- set team 'Civil' on playerJoin
end)

@TorNix~|nR that give the team for all the players with or without teams

21 minutes ago, LopSided_ said:

function joinUnem()
  if not getPlayerTeam(source) then
    setPlayerTeam(source,getTeamFromName("Civil"))
  end
end
addEventHandler("onPlayerLogin",getRootElement(),joinUnem)

 

that is not working

Link to comment
  • Administrators

try

function joinUnem()
  if (getPlayerTeam(source) == false) then
    setPlayerTeam(source,getTeamFromName("Civil"))
  end
end
addEventHandler("onPlayerLogin",getRootElement(),joinUnem)

If that doesn't work then you'll need to show more of your code, such as team creation.

Link to comment
  • Administrators

I assumed you already had the team setup. This'll work

local team = createTeam("Civil", 0, 0, 0) -- Change the team color if you want

function joinUnem()
  if (getPlayerTeam(source) == false) then
    setPlayerTeam(source,getTeamFromName("Civil"))
  end
end
addEventHandler("onPlayerLogin",getRootElement(),joinUnem)
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...