12.09.2015, 16:35
PHP код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == 1)
{
if(weaponid == 34)
{
new Float:armour,Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
GetPlayerArmour(hitid, armour);
if(IsPlayerInRangeOfPoint(hitid, 20.0, x, y, z))
{
if(armour > 0) // se o colete for maior ou igual a 1 :
{
SetPlayerArmour(hitid, 0); // o colete й retirado
}
else // se nao tiver colete a vida й setada a 0 com apenas um tiro
{
SetPlayerHealth(hitid, 0);
}
}
else // se nao tiver na distancia de 20.0 o tiro vai ser normal retirando apenas metade da vida
{
return 1;
}
}
}
return 1;
}

