30.04.2013, 11:50
Hello, I am making a system by which if ill hit a bullet of M4 to someone then he/ she will loose 50% of his HP/ armo.
How can I do it with this function?
Thank you
How can I do it with this function?
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) { new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, attacker, sizeof (attacker)); GetPlayerName(damagedid, victim, sizeof (victim)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); return 1; }