public 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: public OnPlayerTakeDamage (
/showthread.php?tid=434023)
public OnPlayerTakeDamage -
Jay_Dixon - 30.04.2013
Ok, i'm sure i've probably posted too many help threads this past week, what was it? 3? =3
Anyways, i'm having an issue with OnPlayerTakeDamage. I'm basically using it so people won't be idiots, and it'd force them to actually take cover and maybe rp their shootouts (rp server =3). Anyways, with this, it makes the armor useless, so i've come up with something that would hopefully make it deduct the armor first, but instead it one hit kills, or just doesn't even work. Maybe one of you would have better luck solving that issue
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:HP;
new Float:AR;
GetPlayerArmour(playerid,AR);
if(PlayerInfo[playerid][pSArmour] >= 2)
{
if(weaponid == 22) SetPlayerArmour(playerid, AR-50);
if(weaponid == 34) SetPlayerArmour(playerid, AR-200);
if(weaponid == 33) SetPlayerArmour(playerid, AR-100);
if(weaponid == 25) SetPlayerArmour(playerid, AR-70);
return 1;
}
else
{
if(weaponid == 22) SetPlayerHealth(playerid, HP-50);
if(weaponid == 34) SetPlayerHealth(playerid, HP-200);
if(weaponid == 33) SetPlayerHealth(playerid, HP-100);
if(weaponid == 25) SetPlayerHealth(playerid, HP-70);
}
return 1;
}
Re: public OnPlayerTakeDamage -
Jay_Dixon - 30.04.2013
Link please, cuz i can't find it.
Re: public OnPlayerTakeDamage -
Sanguy - 30.04.2013
https://sampforum.blast.hk/showthread.php?tid=38965&page=396
Here you are.