Jump to content

[HELP] setPlayerTeam


Tommy.

Recommended Posts

function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true }; 
function STAFF()
	if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(groupSTAFF)) then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

debugscript:
http://prntscr.com/ds2kqi

 

Link to comment
function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true }; 
function STAFF()
	if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("groupSTAFF")) then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

" " <- These puppies, cannot forget them.

Link to comment
23 minutes ago, CodyL said:

function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true }; 
function STAFF()
	if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("groupSTAFF")) then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

" " <- These puppies, cannot forget them.

 

 

 

function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true }; 
function STAFF()
	if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("groupSTAFF")) then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

 

debugscript:

http://prntscr.com/ds34m0

Link to comment

One second and I'll have fixed one.

function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true };

function isHeIn()
for i,v in pairs(groupSTAFF) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(i)) then
return true
end
end
end
 
function STAFF()
	if isHeIn() then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

Might work.

Link to comment
3 minutes ago, CodyL said:

One second and I'll have fixed one.


function createTEAM ()
	teamSTAFF = createTeam ("STAFF", 0, 255, 255)
end
addEventHandler("onResourceStart", resourceRoot, createTEAM) 

groupSTAFF = { [ "Console" ] = true, [ "Admin"  ] = true, [ "SuperModerator"  ] = true, [ "Moderator" ] = true };

function isHeIn()
for i,v in pairs(groupSTAFF) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(i)) then
return true
end
end
end
 
function STAFF()
	if isHeIn() then
		setPlayerTeam(source, teamSTAFF)
	end
end
addEventHandler("onPlayerLogin",getRootElement(),STAFF) 

Might work.

Thank you, I love you, brother. <3

  • Like 1
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...