Lciprians Posted April 15, 2015 Share Posted April 15, 2015 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
Mr.Loki Posted April 18, 2015 Share Posted April 18, 2015 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
Walid Posted April 18, 2015 Share Posted April 18, 2015 (edited) 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 April 18, 2015 by Guest Link to comment
DNL291 Posted April 18, 2015 Share Posted April 18, 2015 Walid, sourceplayer isn't defined at line 3. Link to comment
Walid Posted April 18, 2015 Share Posted April 18, 2015 Walid, sourceplayer isn't defined at line 3. yeh i forgot to change it 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