Sign in to follow this  
Akranes123

Tags User in ACL

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    
        

Share this post


Link to post
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

Share this post


Link to post

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

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.