SA-MP Forums Archive
OnPlayerTakeDamage problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerTakeDamage problem (/showthread.php?tid=324016)



OnPlayerTakeDamage problem - UtkUguR - 07.03.2012

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.


Re: OnPlayerTakeDamage problem - Minds - 07.03.2012

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



Re: OnPlayerTakeDamage problem - new121 - 08.03.2012

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


Re: OnPlayerTakeDamage problem - cessil - 08.03.2012

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


Re: OnPlayerTakeDamage problem - UtkUguR - 08.03.2012

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.