18.10.2011, 14:33
Hello guys.
How can I do that the cop who is closest to the player that the gets the money?
Currently it is so that all cops who are in the radius 30.0, get the money.
Sincerely, Imagician and here is my code:
if(IsACop(i) && CrimInRange(30.0, playerid, i))
{
count = 1;
format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~%d$", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, price);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
SetPlayerFree(playerid, i, "Erschossen");
}
How can I do that the cop who is closest to the player that the gets the money?
Currently it is so that all cops who are in the radius 30.0, get the money.
Sincerely, Imagician and here is my code:
if(IsACop(i) && CrimInRange(30.0, playerid, i))
{
count = 1;
format(string, sizeof(string), "~w~Gesuchten umgebracht~n~Bonus: ~g~%d$", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, price);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
SetPlayerFree(playerid, i, "Erschossen");
}