OnPlayerTakeDamage - 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 (
/showthread.php?tid=323690)
OnPlayerTakeDamage -
new121 - 06.03.2012
Ok so I am trying to make a system so if you are using god mode from so be it, then you will still loose hp when shot, but it isn't working, anyone know why?
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);
if(GetPlayerWeapon(issuerid) == 24)
{
GivePlayerHealth(playerid, -46);
}
}
return true;
}
Re: OnPlayerTakeDamage -
GNGification - 06.03.2012
Godmode restores your HP so even if that works he just get 100hp again
AW: OnPlayerTakeDamage -
BiosMarcel - 31.08.2012
YOu can use OnPlayerShotPlayer Save his health in a float and if the player have lost 100 or more SetPlayerHealth(playerid,0);