28.07.2013, 15:15
pawn Код:
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;
}
}
}
}
return 0;
}
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;
}