13.12.2011, 22:48
Daew galera do foruns samp tenho uma duvida aqui bem gostosona :P, como defino a life que tira cada tiro de sniper do player em que atiro?
#define SNIPER_DAMAGE 100.0
public OnPlayerTakeDamage(playerid, issuerid, Float:amout, weaponid)
{
if(weaponid == 34)
{
new Float:health[2];
GetPlayerHealth(playerid, health[0]);
GetPlayerArmor(playerid, health[1]);
if(health[1])
{
SetPlayerArmor(playerid, health[1] + amout - SNIPER_DAMAGE);
}
else
{
SetPlayerHealth(playerid, health[0] + amout - SNIPER_DAMAGE);
}
}
return 1;
}