Jump to content

Can somone make this command only work for an ACL group


xXMADEXx

Recommended Posts

This is my script:

function togglestaffMode(thePlayer) 
local account = getPlayerAccount(thePlayer) 
if (not account or isGuestAccount(account)) then return end 
local accountName = getAccountName(account) 
if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "military" ) ) ) then 
    if getElementData(thePlayer,"invincible") then 
        setElementData(thePlayer,"invincible",false) 
        outputChatBox("Staff Mode is now off.",thePlayer,255,0,0) 
    else 
        setElementData(thePlayer,"invincible",false) 
        outputChatBox("Staff Mode is now on.",thePlayer,0,255,0) 
        end 
    end 
end 
  
function createTeamsOnStart () 
        teammili = createTeam ( "Military", 0, 255, 0 ) 
         
end 
addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) 
  
  
    
   function lol ( player, command ) 
    setPlayerTeam ( player, teammili ) 
    setPlayerSkin(player, 287) 
         
end 
addCommandHandler ( "military", lol ) 

Link to comment

There's no need for checking this via script - in fact, it's bad practice since MTA already handles this kind of thing. Disallow the command from the default/Everyone group, allow it specifically for the group(s) that's supposed to use it. Just look at acl.xml and you'll figure out the pattern - if you get in trouble, read the wiki.

Moved to scripting.

Link to comment
There's no need for checking this via script - in fact, it's bad practice since MTA already handles this kind of thing. Disallow the command from the default/Everyone group, allow it specifically for the group(s) that's supposed to use it. Just look at acl.xml and you'll figure out the pattern - if you get in trouble, read the wiki.

Moved to scripting.

OMFG how did i not think of that, i do it all the time, today just isnt my day :lol:

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