OnPlayerTakeDamage problem
#1

Hello there,
I want to prevent damages from OnPlayerTakeDamage, but damages from OnPlayerGiveDamage should still work.
Actually I am trying to prevent lag shooting, and my codes are in OnPlayerGiveDamage.
Well, what should I do now, thanks in advance.
Reply
#2

Код:
public OnPlayerTakeDamage(....)
{
    return 0;//dunno if it works
}
Reply
#3

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID) { //Remove this if statement if you want EVERYTHING to do no damage (falls, explosions, ect still will)
        GivePlayerHealth( playerid, amount );
    }
    return true;
}
credits to 2KY for making it
Reply
#4

you need to set everyone on the same team so that they don't hurt each other, then under OnPlayerGiveDamage damage the damagedid
Reply
#5

Nice point, cessil. I have tried to add a team and put the players in that team but I think I failed, I will need help with the codes. But I'm still working on it. Thank you guys for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)