Jump to content

Unlimited health For admins


Recommended Posts

hey guys, ive got this lil question.

Is it possible to give my admins On my server unlimited health Because on my server Where getting a lil Crazy of the cheaters with miniguns and Youre killed before you know it

So here the question cane one of you guys please make a code for me Wich i can use to give The ADMINS ONLY unlimited health

Regardings, Fatalitry

Link to comment

I don't really think that was his problem... I think he meant that of that only admins should get it. So check if the player is an admin, and then execute the given script. (I really hope he meant that, I need such a thing too :/)

Link to comment

It's very simple:

(get this as an tutorial, and type it over NOT copy, you can learn of it.)

  
local noDeathTimer = nil 
local noDeathActive = false 
local maxHealth = 100 
local useArmor = false 
-- The next variable will only be use able if you set useArmour to true 
local maxArmor = 100 
  
-- Make a function, like this: 
function toggleNoDeath(toggle) 
    if toggle == true then 
        -- Set a timer: setTimer(string function, time, timeToExecute, [arguments]) 
        noDeathTimer = setTimer("updateHealth", 1000, 0) -- 1000 is one seccond. 0 is unlimeted execute. 
        noDeathActive = true 
        -- This is ready here 
    end 
     
    if toggle == false then 
        -- Just kill the timer 
        noDeathActive = false 
        killTimer(noDeathTimer) 
    end 
end 
  
function updateHealth() 
    setElementHealth(source, maxHealth) 
     
    if useArmor == true then 
        setPlayerArmor(source, maxArmor) 
    end 
end 
  
-- Create the command 
function setNoDeath(source) 
    if source then 
        -- Check for admin, i don't know how. 
       if hasObjectPermissionTo ( playerSource, "function.kickPlayer", false ) then 
       if noDeathActive == true then 
            toggleNoDeath(false) 
        else 
            toggleNoDeath(true) 
        end 
        end 
    end 
end 
  
addCommandHandler("nodeath", getRootElement(), setNoDeath) 
  

hope it is helping you!

Link to comment
It's very simple:

(get this as an tutorial, and type it over NOT copy, you can learn of it.)

  
[...] 
  

hope it is helping you!

Probably not - miniguns can swat you down from 100armor + 100hp in way less than one second. OnPlayerDamage is more reliable since it can restore the damage as soon as it occurs (in ideal environments, which is to say no lag), it might even be possible to cancel the event itself and then the damage is never even dealt, but i don't know if that's possible with this particular event.

Link to comment

Please don't abuse the ACL like that :) Add your own 'resource.YourResourceName.infinitehealth' ACL right, don't check for kickplayer etc. This allows the admin to configure it so that any group could have infinite health without giving them kickplayer access...

Link to comment
You can only cancel damage to a player on the client side. Calling cancelEvent() in onClientPlayerDamage will do the trick.

Well, you could do that and remote control it with Events from the server. Or just make it all clientside.

Link to comment
  • 1 year later...
Please don't abuse the ACL like that :) Add your own 'resource.YourResourceName.infinitehealth' ACL right, don't check for kickplayer etc. This allows the admin to configure it so that any group could have infinite health without giving them kickplayer access...

Sorry for opening up an old thread.

I do not know if i have understood this: I can set "infinite Health" in the ACL? Then i dont check how.

And sorry 2 4 the question, but i am no scripter, so i need your help :)

Playsi

PS.: Again i am not perfect in the english language, so please collect the mistakes and sell them ^^

Link to comment

acl is a list of allowed and disallowed actions for different user types (normal,admin,moderator,[...]) you can script functions which only work for admins,moderators or whatever group of people you want to have. you could also add a "trusted users" list for example, and only make them able to votekick others. the possibilities are up to your imagination. the only thing you'll have to use is hasObjectPermissionTo.

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