If in range of a cop
#1

Here's what i'm trying to do:
Код:
stock NearPolice(playerid)
{
	foreach(new i : Player)
	{
	    if(IsPlayerConnected(i)){
	    if(i != playerid){
	        if(PlayerInfo[i][pClass] == TEAM_POLICE){
	            new Float:datx,Float:daty,Float:datz;
	            	GetPlayerPos(i,datx,daty,datz);
	                if(IsPlayerInRangeOfPoint(playerid,100.0,datx,daty,datz)) return _:1;
	                else return _:0;
	        }
			}
	    }
	}
	return 1;
}

CMD:reclass(playerid,params[])
{
	if(PlayerInfo[playerid][pSpawned] == 0) return SendClientMessage(playerid,COLOR_RED,"Only spawned players can use this command.");
	if(/*PlayerInfo[playerid][pFines] > 0 && */NearPolice(playerid) == 1) return SendClientMessage(playerid,COLOR_RED,"You cannot use this command while you have fines near a cop.");
	ForceClassSelection(playerid);
	TogglePlayerSpectating(playerid,true);
	TogglePlayerSpectating(playerid,false);
	return 1;
}
However it always says that I cannot use that command near a cop, even tho there is no cop online.
Reply


Messages In This Thread
If in range of a cop - by wumpyc - 28.07.2013, 15:11
Re: If in range of a cop - by Darnell - 28.07.2013, 15:14
Re: If in range of a cop - by Aliassassin123456 - 28.07.2013, 15:15
AW: If in range of a cop - by Harry :) - 28.07.2013, 15:18
Re: If in range of a cop - by wumpyc - 28.07.2013, 15:19
Re: If in range of a cop - by wumpyc - 28.07.2013, 15:22
Re: If in range of a cop - by Aliassassin123456 - 28.07.2013, 15:24
Re: If in range of a cop - by Darnell - 28.07.2013, 15:28
Re: If in range of a cop - by wumpyc - 28.07.2013, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)