03.06.2012, 18:31
Making an /arrest command, and if you type no parameters it will arrest the closest suspect, which works fine, but if I try and do /arrest [id] it keeps telling me the player is too far away.
Console output:
[19:39:52] DIST: 3.827519 RADIUS: 10.000000
What the fuck is going on -_-
Clearly 3.827519 is not > 10 so why on earth am I getting that message? :/
pawn Код:
#define ARREST_RADIUS 10.0
printf("DIST: %f RADIUS: %f", GetDistanceBetweenPlayers(playerid, id), ARREST_RADIUS);
if(GetDistanceBetweenPlayers(playerid, id) > ARREST_RADIUS) return SendClientMessage(playerid, COLOR_RED, "Suspect is too far away.");
[19:39:52] DIST: 3.827519 RADIUS: 10.000000
pawn Код:
forward Float:GetDistanceBetweenPlayers(player1, player2);
Float:GetDistanceBetweenPlayers(player1, player2)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(player2, x, y, z);
return GetPlayerDistanceFromPoint(player1, x, y, z);
}
Clearly 3.827519 is not > 10 so why on earth am I getting that message? :/