CMD:docarrest(playerid, params[])
{
if(IsACop(playerid)) {
if(!IsPlayerInRangeOfPoint(playerid, 12.0, 1788.3121, -1569.8536, 22.9151) || !IsPlayerInRangeOfPoint(playerid, 12.0, 1760.0992, -1541.9899, 9.3473))
{
SendClientMessageEx(playerid, COLOR_GREY, "You're not at DoC Facilities.");
return 1;
}
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /docarrest [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid == playerid) {
return SendClientMessageEx(playerid, COLOR_GREY, "You can't arrest yourself.");
}
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
new string[37 + MAX_PLAYER_NAME];
SetPVarInt(giveplayerid, "IsFrozen", 0);
format(string, sizeof(string), "* You've brought %s to DoC Facilities.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s brought you to DoC Facilities.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~w~Welcome to ~n~~r~DoC Facilities", 5000, 3);
TogglePlayerControllable(giveplayerid, 1);
ClearAnimations(giveplayerid);
PlayerCuffed[giveplayerid] = 0;
SetPVarInt(giveplayerid, "PlayerCuffed", 0);
format(PlayerInfo[giveplayerid][pPrisonedBy], 24, "%s", GetPlayerNameEx(playerid));
format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[IC] Military Apprehension");
WantedPoints[giveplayerid] = 0;
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerToTeamColor(giveplayerid);
SetPlayerWantedLevel(giveplayerid, 0);
SetPlayerSkin(giveplayerid, 50);
PlayerInfo[giveplayerid][pJailed] = 2;
PhoneOnline[giveplayerid] = 1;
PlayerInfo[giveplayerid][pJailTime] = 3600;
SetPlayerInterior(giveplayerid, 1);
PlayerInfo[giveplayerid][pInt] = 1;
SetPlayerSkin(giveplayerid, 50);
SetPlayerVirtualWorld(giveplayerid, 0);
PlayerInfo[giveplayerid][pVW] = 0;
SetPlayerColor(giveplayerid, TEAM_ORANGE_COLOR);
GameTextForPlayer(giveplayerid, "Objects loading...", 1000, 5);
SetPVarInt(giveplayerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", giveplayerid);
new rand = random(sizeof(ICPrisonSpawns));
Streamer_UpdateEx(giveplayerid, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
SetPlayerPos(giveplayerid, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
ResetPlayerWeaponsEx(giveplayerid);
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
return 1;
}
}
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 12.0, 1788.3121, -1569.8536, 22.9151) || !IsPlayerInRangeOfPoint(playerid, 12.0, 1760.0992, -1541.9899, 9.3473))
if(!IsPlayerInRangeOfPoint(playerid, 12.0, 1788.3121, -1569.8536, 22.9151) && !IsPlayerInRangeOfPoint(playerid, 12.0, 1760.0992, -1541.9899, 9.3473))
pawn Код:
|
That means the player could be in range of one point, but still not be able to use the command because the player isn't in range of the other point. Therefore it should be || and the OP's code is fine.
|
That means the player could be in range of one point, but still not be able to use the command because the player isn't in range of the other point. Therefore it should be || and the OP's code is fine.
|