1LoL1 Posted May 18, 2014 Share Posted May 18, 2014 (edited) Deleted.. Edited May 19, 2014 by Guest Link to comment
Dealman Posted May 18, 2014 Share Posted May 18, 2014 Try something like this, I haven't tested it though. function restoreAllBlood_CMD(thePlayer, theCMD) local accountName = getAccountName(getPlayerAccount(thePlayer)) if(accountName) then if(isObjectInACLGroup("user."..accountName, aclGetGroup("Admin"))) then local alivePlayers = getAlivePlayers(); if(alivePlayers ~= false) then for key, value in ipairs(alivePlayers) do setElementBlood(value, 12000); outputChatBox("Server: Your blood was restored to full by an Admin!", value, 0, 255, 0); end end else outputChatBox("Server: You're not a server Admin you can't use this command.", thePlayer, 255, 0, 0); end end end addCommandHandler("BloodAll", restoreAllBlood_CMD, false, false); Link to comment
1LoL1 Posted May 18, 2014 Author Share Posted May 18, 2014 (edited) Deleted.. Edited May 19, 2014 by Guest Link to comment
xXMADEXx Posted May 18, 2014 Share Posted May 18, 2014 setElementBlood isn't a function of MultiTheftAuto, and players can only have health on between 0-100. Use this as the loop: for _, p in pairs ( alivePlayers ) do setElementHealth ( p, 100 ) outputChatBox("Server: Your blood was restored to full by an Admin!", p, 0, 255, 0) end Link to comment
1LoL1 Posted May 18, 2014 Author Share Posted May 18, 2014 setElementBlood isn't a function of MultiTheftAuto, and players can only have health on between 0-100. Use this as the loop: for _, p in pairs ( alivePlayers ) do setElementHealth ( p, 100 ) outputChatBox("Server: Your blood was restored to full by an Admin!", p, 0, 255, 0) end But I would not want to DayZ Mod .. and there is no Blood Health Link to comment
pa3ck Posted May 19, 2014 Share Posted May 19, 2014 function restoreAllBlood_CMD(thePlayer, theCMD) local accountName = getAccountName(getPlayerAccount(thePlayer)) if(accountName) then if(isObjectInACLGroup("user."..accountName, aclGetGroup("Admin"))) then local alivePlayers = getAlivePlayers(); if(alivePlayers ~= false) then for key, value in ipairs(alivePlayers) do setElementData(value, "blood", 12000); -- AFAIK that's the way it works in DayZ outputChatBox("Server: Your blood was restored to full by an Admin!", value, 0, 255, 0); end end else outputChatBox("Server: You're not a server Admin you can't use this command.", thePlayer, 255, 0, 0); end end end addCommandHandler("BloodAll", restoreAllBlood_CMD, false, false); 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