Akranes123 Posted January 26, 2017 Share Posted January 26, 2017 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
Dimos7 Posted January 27, 2017 Share Posted January 27, 2017 (edited) 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 January 27, 2017 by Dimos7 Link to comment
Akranes123 Posted January 27, 2017 Author Share Posted January 27, 2017 Not working D: Link to comment
Dimos7 Posted January 27, 2017 Share Posted January 27, 2017 are you sure the is a acl group with that name and team with that name? Link to comment
Akranes123 Posted January 29, 2017 Author Share Posted January 29, 2017 Yes, I'm sure that's why I sent it like this Link to comment
marty000123 Posted January 29, 2017 Share Posted January 29, 2017 (edited) 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 January 29, 2017 by marty000123 Link to comment
Akranes123 Posted February 8, 2017 Author Share Posted February 8, 2017 marty000123 D: not working Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now