03.05.2016, 19:32 
	
	
	
		This should do the job sir
Usage:
PlayersDistanceZZ(playerid); // check if player is near any player if not returns -255
PlayersDistanceZZ(playerid,player1); // checks if player is near another player if not returns -255
Example:
	
	
	
	
PHP код:
PlayersDistanceZZ(playerid,player1 = -255) {
   if(player1 == -255) {
     for(new i = 0; i < MAX_PLAYERS; i++) {
         if(!IsPlayerConnected(i) || i == playerid) continue;
         new Float:X1,Float:Y1,Float:Z1;
         GetPlayerPos(i, X1, Y1, Z1);
         if(IsPlayerInRangeOfPoint(playerid, 5.0, X1, Y1, Z1)) {
            return i;
         }
     }
     return -255;
   }
   else {
      new Float:X1,Float:Y1,Float:Z1;
      GetPlayerPos(player1, X1, Y1, Z1);
      if(IsPlayerInRangeOfPoint(playerid, 5.0, X1, Y1, Z1)) {
          return player1;
      }
      else {
          return -255;
      }
   }
} 
PlayersDistanceZZ(playerid); // check if player is near any player if not returns -255
PlayersDistanceZZ(playerid,player1); // checks if player is near another player if not returns -255
Example:
PHP код:
CMD:rape(playerid, params[])
{
    new rapedid;
    if  (!IsPlayerSpawned(playerid) || PlayerData[playerid][pJailTime] > 0)
        return SendErrorMessage(playerid, "You Cannot Use This Command Right Now");
    if    (PlayerData[playerid][pOnDuty])
        return SendErrorMessage(playerid, "You Cannot Use This Command Whilst On-Duty.");
        
    new PDest = PlayersDistanceZZ(playerid);
    if(PDest == -255) {
       if  (sscanf(params, "u", rapedid))
           return SendSyntaxMessage(playerid, "/rape (playerid / Name).");
           // the job
           /*
           you now can also to check if player is near player by
           
           if(PlayersDistanceZZ(playerid, trpedid) == -255) return 1;
           */
    }
    else { // if he's near any player
     // the job
    }
        
} 

