Jump to content

Command reserved to Admin [HELP]


Recommended Posts

Hi,

I have problem with this script:

function toggleGGun(player) 
    local accName = getAccountName ( getPlayerAccount ( source ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) 
    local on = not exports.gravity_gun:isGravityGunEnabled(player) 
    exports.gravity_gun:togglePlayerGravityGun(player,on) 
    outputChatBox("gravity gun "..(on and "on" or "off"),player) 
end 
addCommandHandler("ggun",toggleGGun) 
  

I want this script is reserved to Admin.

I add this code:

    local accName = getAccountName ( getPlayerAccount ( source ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) 

but its not working please help me..

Link to comment
  
function toggleGGun(player) 
local acc = getPlayerAccount ( player ) 
if not isGuestAccount  ( acc ) then return end 
    local accName = getAccountName ( acc ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) 
    local on = not exports.gravity_gun:isGravityGunEnabled(player) 
    exports.gravity_gun:togglePlayerGravityGun(player,on) 
    outputChatBox("gravity gun "..(on and "on" or "off"),player) 
end 
addCommandHandler("ggun",toggleGGun) 
  

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