Jump to content

[HELP] Please


1LoL1

Recommended Posts

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

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

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