24.01.2011, 19:38
hi all . i have a problem this is the code
the problems is some times (if the the playerid doesn't touche the targerid withe hits ) the targetid die but it's not because of the playerid ! it's just caus the tagetid losse all he's HP caus of the distance
can some one help
Код:
if((newkeys & KEY_FIRE) && (team[playerid] == 6))
{
new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
GetPlayerArmour(target,a);
if(a > 0)
{
SetPlayerArmour(target, a-20);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid, hp+5);
}
else
{
GetPlayerHealth(target,hp);
SetPlayerHealth(target, hp-7);
GetPlayerHealth(playerid,hp);
if(hp < 200) SetPlayerHealth(playerid, hp+10);
GetPlayerHealth(target,hp);
}
}
can some one help

