29.09.2013, 07:09
I use this script for anti-lag system:
When i kill somebody with Deagle it takes 2x damage, i read as I need to put on OnPlayerSpawn :
Ok, i put this and when i kill somebody damage is good but the CallBack OnPlayerDeath doesn't call. In server log when i kill show like that:
instead of
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount) { new Float:health, Float:armour; GetPlayerHealth(damagedid, health); GetPlayerArmour(damagedid, armour); if(armour == 0.0) // No armour, just take health { health -= amount; if(health < 0.0) health = 0; } else // There is armour, take what is needed { if(armour-amount < 0.0) // Health needs to be taken { health -= (amount - armour); armour = 0; } else armour -= amount; } SetPlayerHealth(damagedid, health); SetPlayerArmour(damagedid, armour); return 1; }
Код:
SetPlayerTeam(playerid, 4);
Код:
[death] Awesome. died 255
Код:
[kill] Awesome. killed Jadooze Desert Eagle