Jump to content

afk problem


BorderLine

Recommended Posts

Posted

hi all

well more than a code

i want know why when i active godmode

zombies can hitme and low my health :S

i mean he cause damage

i need other fuction? like canceldamage?

thanks so much

Posted

That's because zombies use setElementHealth, that cannot be canceled, so you have to do this:

addEventHandler("onClientPlayerDamage",root, 
function () 
     setElementHealth(source,100) 
end) 

Posted

and exist some fuction for freeze your health.

i mean.. if some player have 1 health

just he will be afk and his health will be 100 again .

i was searching but i found nothing

Posted

Yes it does. Tested with "zombies" resource (do you remember I told you a long time ago about "AC#1" kicking me when a zombie was punching me? It was cancelEvent() applied to onClientPlayerDamage ;))

Posted (edited)

If it does, then why is a zombie taking my health when I executed this via runcode:

addEventHandler("onClientPlayerDamage",getRootElement(), function () cancelEvent() end) 

Edited by Guest
Posted (edited)
Edit: onPlayerDamage is triggered when you do setElementHealth though.

onPlayerDamage cannot be cancelled. You edited wrong lol (or maybe you used onPlayerDamage at runcode and failed?)

Edited by Guest
Posted (edited)

It did at MTA 1.0.4.

The effect cancel of setElementHealth made my player to be kicked out due to AntiCheat #1

So I say "IT SHOULD WORK WITH setElementHealth".

Cannot try zombies resource atm, I'll do later (in about 11 hours xD)

Edited by Guest
Posted
Edit: onPlayerDamage is triggered when you do setElementHealth though.

onPlayerDamage cannot be cancelled. You edited wrong lol (or maybe you used onPlayerDamage at runcode and failed?)

I just said that onPlayerDamage is triggered with setElementHealth, I know that it cannot be cancelled.

Posted
I just said that onPlayerDamage is triggered with setElementHealth, I know that it cannot be cancelled.

What the...

You first spoke about onClientPlayerDamage, then about onPlayerDamage. For me it doesn't make much sense...

Nvm.

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