Jump to content

Tags User in ACL


Akranes123

Recommended Posts

Hola a todos me podrian ayudar en este script que estoy creando ....

Quiero que Cuando le de un equipo a un Usuario por ejemplo Militar y a lo que le de Militar Automaticamente lo añada a un Grupo ACL ..

Este es mi Script

 

---------------------------------

Server.lua

 

 function tag( (playerSource,team, accountName)
 
 if ( getTeamName( team ) == "**Militar**" ) then
 
     aclGroupAddObject (aclGetGroup("Militar"), "user."..accountName))
     
     else
     
     aclGroupRemoveObject (aclGetGroup("Militar"), "user."..accountName))
     
end    
        

Link to comment
function tag(thePlayer)
  if getTeamName(getPlayerTeam(thePlayer)) == "**Militar**" then
  aclGroupAddObject(aclGetGroup("Militar"), "user."..getAccountName(getPlayerAccount(thePlayer)))
  else
  aclGroupRemoveObject(aclGetGroup("Militar"), "user."..getAccountName(getPlayerAccount(thePlayer)))
  end
end

 

Edited by Dimos7
Link to comment

try this

function addTag(player)
    if getTeamName(getPlayerTeam(player)) == "**Militar**" then
         aclGroupAddObject(aclGetGroup("Militar"), "user."..getAccountName(getPlayerAccount(player)))
    end
end
addEventHandler("onPlayerSpawn", getElementData(), addTag)

function removeTag(player)
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Militar" ) ) then
        aclGroupRemoveObject(aclGetGroup("Militar"), "user."..getAccountName(getPlayerAccount(player)))
    end
end
addEventHandler("onPlayerWasted", getElementData(), removeTag)
addEventHandler("onPlayerQuit", getElementData(), removeTag)
	
Edited by marty000123
Link to comment
  • 2 weeks later...

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