Jump to content

Add Restriction .


Lciprians

Recommended Posts

Anyone can access this command...I want her to be just for administrators

Please..Help me.(Sorry for my bad English)

function bless () 
for id, player in ipairs(getElementsByType("player")) do 
        setElementData(player,"blood", 12000) 
        setElementData(player,"bleeding", 0) 
        setElementData(player,"cold", false) 
        setElementData(player,"temperature", 37) 
        setElementData(player,"pain", false) 
        setElementData(player,"brokenbone", false) 
        setElementData(player,"thirst", 100) 
        setElementData(player,"food", 100) 
end 
    outputChatBox("#6495ED[DVOORN]#C0C0C0All players were cured.!", thePlayer, 255, 255, 255, true) 
end 
addCommandHandler("aheall", bless) 

Link to comment
  
function bless (spurceplayer) 
if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(sourceplayer)), aclGetGroup("Admin")) then 
    for id, player in ipairs(getElementsByType("player")) do 
        setElementData(player,"blood", 12000) 
        setElementData(player,"bleeding", 0) 
        setElementData(player,"cold", false) 
        setElementData(player,"temperature", 37) 
        setElementData(player,"pain", false) 
        setElementData(player,"brokenbone", false) 
        setElementData(player,"thirst", 100) 
        setElementData(player,"food", 100) 
    end 
    outputChatBox("#6495ED[DVOORN]#C0C0C0All players were cured.!", thePlayer, 255, 255, 255, true) 
end 
end 
addCommandHandler("aheall", bless) 

or

for only players who you have added to /add admin player

  
function bless (spurceplayer) 
if getElementData(playersource,"admin") then 
    for id, player in ipairs(getElementsByType("player")) do 
        setElementData(player,"blood", 12000) 
        setElementData(player,"bleeding", 0) 
        setElementData(player,"cold", false) 
        setElementData(player,"temperature", 37) 
        setElementData(player,"pain", false) 
        setElementData(player,"brokenbone", false) 
        setElementData(player,"thirst", 100) 
        setElementData(player,"food", 100) 
    end 
    outputChatBox("#6495ED[DVOORN]#C0C0C0All players were cured.!", thePlayer, 255, 255, 255, true) 
end 
end 
addCommandHandler("aheall", bless) 

:)

Link to comment

4fd17ba986.png

f47005d9c3.png

change (playersource;theplayer) to spurceplayer.

Code:

function bless (spurceplayer) 
if isElement (spurceplayer) then  
local account = getPlayerAccount(spurceplayer) 
 if ( not account or isGuestAccount ( account ) ) then return end  
   if isObjectInACLGroup("user." .. getAccountName(account), aclGetGroup("Admin")) then 
       for id, player in ipairs(getElementsByType("player")) do 
         setElementData(player,"blood", 12000) 
         setElementData(player,"bleeding", 0) 
         setElementData(player,"cold", false) 
         setElementData(player,"temperature", 37) 
         setElementData(player,"pain", false) 
         setElementData(player,"brokenbone", false) 
         setElementData(player,"thirst", 100) 
         setElementData(player,"food", 100) 
    end 
    outputChatBox("#6495ED[DVOORN]#C0C0C0All players were cured.!", spurceplayer, 255, 255, 255, true) 
  end 
 end 
end  
addCommandHandler("aheall", bless) 

Edited by Guest
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...