Lciprians Posted April 15, 2015 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)
Mr.Loki Posted April 18, 2015 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) [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
Walid Posted April 18, 2015 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 Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
DNL291 Posted April 18, 2015 Posted April 18, 2015 Walid, sourceplayer isn't defined at line 3. Please do not PM me with scripting related question nor support, use the forums instead.
Walid Posted April 18, 2015 Posted April 18, 2015 Walid, sourceplayer isn't defined at line 3. yeh i forgot to change it Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
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