Tente dessa forma.
pawn Code:
static Float:DistanciaDisparo[] = {
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1.0,
1.1,
1.2,
1.3,
1.4,
1.5,
1.6,
1.7,
1.8,
1.9,
2.0
};
// -
//
// -
new
Float: x,
Float: y,
Float: z,
Float: a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
for (new i = 0; i < MAX_PLAYERS; i++) {
if(playerid == i) {
continue;
}
for (new j = 0; j < sizeof(DistanciaDisparo); j++) {
x += (DistanciaDisparo[j] * floatsin(-a, degrees));
y += (DistanciaDisparo[j] * floatcos(-a, degrees));
if(IsPlayerInRangeOfPoint(i, 0.5, x, y, z)) {
new
Float: health;
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 5.0);
}
}
}