Damage reflection issue - 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: Damage reflection issue (
/showthread.php?tid=385492)
Damage reflection issue -
HeLiOn_PrImE - 16.10.2012
I am building a server on which fighting won't be allowed (racing server).
Weapon restriction is a problem, because people will always use hacks to get weapons and there will be moments when no staff member will be present. So I am trying to make all the damage inflicted to be reflected to the attacker.
I am trying this simple code, but I keep getting tag mismatch warnings on 2 lines. the bolded ones.
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new health = GetPlayerHealth(playerid,health);
new health2 = floatsub(health, amount);
SetPlayerHealth(playerid, health2);
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
SetPlayerHealth(playerid, 100);
}
So the question is: what mistake is causing those 2 warnings?
AW: Damage reflection issue -
BiosMarcel - 16.10.2012
PHP код:
new Float:health;
GetPlayerHealth(playerid,health);
new Float:health2;
health2 = floatsub(health, amount);
Re: Damage reflection issue -
HeLiOn_PrImE - 16.10.2012
thanks..