12.09.2015, 17:59
PHP код:
/*
Distвncia >= 20
- Colete != 0: zera o colete
- Colete == 0: zera a vida
Distвncia < 20
- Colete != 0: nгo danifica
- Colete == 0: tira 10 de vida.
*/
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == 1)
{
if(weaponid == 34)
{
static
Float:health,
Float:armour;
GetPlayerHealth(hitid, health);
GetPlayerArmour(hitid, armour);
new Float:distance = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
if(distance >= 20.0)
{
if(armour)
{
SetPlayerArmour(hitid, 0);
}
else
{
SetPlayerHealth(hitid, 0);
}
}
else
{
if(!armour)
{
SetPlayerHealth(hitid, (health - 10));
}
}
}
}
return 1;
}

