04.10.2014, 07:18
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:HP,Float:gain;
GetPlayerHealth(playerid, HP);// ex: HP==65
if(weaponid == 25)
{
gain=amount*0.25 //25 percent ex: amount(damage teken)=35 so 35*0.25==8.75
SetPlayerHealth(playerid,HP+gain);//HP==65+8.75
}
return 1;
}
//overall damage dealt by shotgun==26.25 {100-73.75}regardless of original amount send by client which is 35