23.07.2018, 16:49
Quote:
Instead of getting the position of every player and compare if the cop is in range, do the opposite. Get the cop's position only once before the loop and then check if criminals are in range. Also avoid returning 0.
|
PHP код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(targetid, X, Y, Z);
foreach(new targetid : Player)
{
if(IsPlayerInRangeOfPoint(targetid, 10, X, Y, Z)
{
//Put your whole arrest code here..
}
}