Jump to content

incomingDamage and playerDamage built-in-functions


Recommended Posts

Posted

Hello! I'm trying to use incomingDamage built-in-function, in order to do some players immortals , but I cant make it work, and the documentation is not the best.

I was told that, if i return true, the damage would be canceled

spacer.png
 

I also tried playerDamage function, in order to do the same, but the event does not trigger either.

spacer.png

Posted

Hello, try

mp._events.add('incomingDamage', (sourceEntity, sourcePlayer, targetEntity, weapon, boneIndex, damage) => {
    return true;
});
Posted (edited)

Thanks for answering. The event still does not trigger. The file is properly included.

Perhaps this path is wrong?

spacer.png

 

Btw, the way I'm testing is throwing a molotov, and entering to the fire. It shouldn't matter anyway

Edited by Ocho
  • 2 weeks later...
  • 4 years later...
Posted (edited)

it didn't work for me so i did like this.

Serverside:

player.call('setMeInvincible', [true]);


 

Clientside:

mp.events.add("setMeInvincible", (yesorno) => {

    mp.players.local.setInvincible(yesorno);

});
 
Edited by XXX10Tacles

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