Jump to content

Teams


Recommended Posts

i have a problem i want to be when admin login he's get into admins team and when a member login he's get in the members team, but when a member login they get into admin team why?

function createTeamsOnStart ()
teamAdmins = createTeam ( "Admins", 255, 100, 0 )
teamMembers = createTeam ( "Members", 0, 0, 255 )
teamGuests = createTeam ( "Guests", 255, 255, 255 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )
 
addEventHandler( 'onPlayerJoin', root,
 function()
     setPlayerTeam ( source, teamGuests )
 end
)
 
addEventHandler( 'onPlayerLogin', root,
 function()
   if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
     setPlayerTeam ( source, teamAdmins )
   else
     setPlayerTeam ( source, teamMembers )
   end
 end
)

Link to comment
i have a problem i want to be when admin login he's get into admins team and when a member login he's get in the members team, but when a member login they get into admin team why?

function createTeamsOnStart ()
teamAdmins = createTeam ( "Admins", 255, 100, 0 )
teamMembers = createTeam ( "Members", 0, 0, 255 )
teamGuests = createTeam ( "Guests", 255, 255, 255 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )
 
addEventHandler( 'onPlayerJoin', root,
 function()
     setPlayerTeam ( source, teamGuests )
 end
)
 
addEventHandler( 'onPlayerLogin', root,
 function()
   if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
     setPlayerTeam ( source, teamAdmins )
   else
     setPlayerTeam ( source, teamMembers )
   end
 end
)

look this line:

addEventHandler( '[color=#FF0000]onPlayerLogin[/color]', root,
function()
if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
setPlayerTeam ( source, teamAdmins )
else
setPlayerTeam ( source, teamMembers )
end
end

its onplayerlogin you need to change some things man

Link to comment
i have a problem i want to be when admin login he's get into admins team and when a member login he's get in the members team, but when a member login they get into admin team why?

function createTeamsOnStart ()
teamAdmins = createTeam ( "Admins", 255, 100, 0 )
teamMembers = createTeam ( "Members", 0, 0, 255 )
teamGuests = createTeam ( "Guests", 255, 255, 255 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )
 
addEventHandler( 'onPlayerJoin', root,
 function()
     setPlayerTeam ( source, teamGuests )
 end
)
 
addEventHandler( 'onPlayerLogin', root,
 function()
   if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
     setPlayerTeam ( source, teamAdmins )
   else
     setPlayerTeam ( source, teamMembers )
   end
 end
)

look this line:

addEventHandler( '[color=#FF0000]onPlayerLogin[/color]', root,
function()
if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
setPlayerTeam ( source, teamAdmins )
else
setPlayerTeam ( source, teamMembers )
end
end

do you see the errors? tip: 1st line

Link to comment
what should i chanhge to???
function createTeamsOnStart ()
  teamAdmins = createTeam ( "Admins", 255, 100, 0 )
  teamMembers = createTeam ( "Members", 0, 0, 255 )
  teamGuests = createTeam ( "Guests", 255, 255, 255 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )
 
addEventHandler( "onPlayerJoin", root,
function()
setPlayerTeam ( source, teamGuests )
end
)
 
addEventHandler("onPlayerLogin", root,
function()
if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
setPlayerTeam ( source, teamAdmins )
else
setPlayerTeam ( source, teamMembers )
end
end)

this one works :)

Link to comment
what should i chanhge to???
function createTeamsOnStart ()
  teamAdmins = createTeam ( "Admins", 255, 100, 0 )
  teamMembers = createTeam ( "Members", 0, 0, 255 )
  teamGuests = createTeam ( "Guests", 255, 255, 255 )
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )
 
addEventHandler( "onPlayerJoin", root,
function()
setPlayerTeam ( source, teamGuests )
end
)
 
addEventHandler("onPlayerLogin", root,
function()
if isObjectInACLGroup( 'user.Albinix', aclGetGroup( 'Admin' ) ) then
setPlayerTeam ( source, teamAdmins )
else
setPlayerTeam ( source, teamMembers )
end
end)

this one works :)

what have you changed?

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