26.08.2018, 12:11
I made a stock to check if player is near a cop:
But i want to add radius to this stock, so i can use it like:
IsPlayerNearALawEnforcement(playerid, 20)
How?
pawn Код:
stock IsPlayerNearALawEnforcement(playerid)
{
new team = GetPlayerTeam(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
foreach (new i : Player)
{
if (i != playerid)
{
if (team != gTeam(i) == TEAM_COP)
{
if (IsPlayerInRangeOfPoint(i, 20.0, x, y, z))
{
return true;
}
}
}
}
return false;
}
IsPlayerNearALawEnforcement(playerid, 20)
How?
