04.06.2015, 23:14
Eu desejo saber como alterar, o sistema, tipo, a pessoa dб um soco na outra aqui e a pessoa perde vida, eu queria saber de uma base de como nгo deixar que isso aconteзa, alguйm sabe como posso definir isso pf?
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) {
if ( weaponid == 0 || weaponid == 1 ) // soco e soqueira
return 0;
return 1;
}
PHP код:
Beijos! |
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) {
if ( weaponid == 0 || weaponid == 1 ) // soco e soqueira
{
static
Float: damage[2]
;
GetPlayerHealth(damagedid, damage[0]);
GetPlayerArmour(damagedid, damage[1]);
SetPlayerHealth(damagedid, amount + damage[0]);
SetPlayerArmour(damagedid, amount + damage[0]);
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) { if(weaponid == 0 || weaponid == 1) { new Float:health, Float:armour; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); if(armour > 0) { SetPlayerArmour(playerid, armour + amount); } else { SetPlayerHealth(playerid, health + amount); } } return 1; }