I don't understand sorry, CAn you make it with my cmd. thanks.
PHP код:
CMD:ar(playerid, params[])
{
new rangepass = 0, vehiclepass = 0, wantedpass = 0, dutypass = 0, eventpass = 0, arrestpass = 0;
if((gettime() - 5) < TimerInfo[playerid][CMD_timer30]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
if(GetTeam{playerid} == CLASS_CIV || GetTeam{playerid} == CLASS_MEDIC) return SendClientMessage(playerid, RED, "Only law enforcement can arrest players.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You cant arrest players from a vehicle.");
foreach(Player, i)
{
if(i == playerid) continue;
new Float:x, Float:y, Float:z;
GetPlayerPos(i, x, y, z);
new Float:hp;
GetPlayerHealth(i, hp);
if(hp > 0.0)
if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z) && GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
rangepass++;
if(GetPlayerWantedLevel(i) >= 4)
{
wantedpass++;
if(!IsPlayerInAnyVehicle(i))
{
vehiclepass++;
if(IsOnduty{i} == 0)
{
dutypass++;
if(IsAtEvent{i} == 0)
{
eventpass++;
if(HasBeenArrested{i} == false)
{
arrestpass++;
if(GetTeam{playerid} == CLASS_COPS)
{
PlayerInfo[i][pArrests] ++;
TogglePlayerControllable(i, false);
GameTextForPlayer(i, "~r~Arrested!", 3000, 5);
format(fstr, sizeof(fstr), "Officer %s (%d) has just arrested you.", GetName(playerid), playerid);
SendClientMessage(i, COLOR_AQUA, fstr);
GameTextForPlayer(playerid,"~w~Suspect ~g~Arrested.",5000,5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
new pay = random(10000) + 5000;
GivePlayerCash(playerid, pay);
PlayerInfo[playerid][pTakedowns] ++;
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.1, 0, 1, 1, 1, 1);
format(fstr2, sizeof(fstr2), "%s (%d) has been arrested by Officer %s (%d)", GetName(i), i, GetName(playerid), playerid);
SendClientMessageToAll(COLOR_AQUA, fstr2);
SetPlayerScore(i, GetPlayerScore(i) - 1);
SetPlayerSpecialAction(i, SPECIAL_ACTION_HANDSUP);
SetTimerEx("SendPlayerToJail", 2000, false, "d", i);
HasBeenArrested{i} = true;
break;
}
else if(GetTeam{playerid} == CLASS_CIA)
{
PlayerInfo[i][pArrests] ++;
TogglePlayerControllable(i, false);
GameTextForPlayer(i, "~r~Arrested!", 3000, 5);
SendClientMessage(i, COLOR_AQUA, "You have been arrested by a Undercover CIA Agent.");
GameTextForPlayer(playerid,"~w~Suspect ~g~Arrested.",5000,5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
new pay = random(10000) + 5000;
GivePlayerCash(playerid, pay);
PlayerInfo[playerid][pTakedowns] ++;
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.1, 0, 1, 1, 1, 1);
format(fstr, sizeof(fstr), "%s (%d) has been arrested by a Undercover CIA Agent.", GetName(i), i);
SendClientMessageToAll(COLOR_AQUA, fstr);
SetPlayerScore(i, GetPlayerScore(i) - 1);
SetPlayerSpecialAction(i, SPECIAL_ACTION_HANDSUP);
SetTimerEx("SendPlayerToJail", 2000, false, "d", i);
HasBeenArrested{i} = true;
break;
}
else if(GetTeam{playerid} == CLASS_FBI)
{
PlayerInfo[i][pArrests] ++;
TogglePlayerControllable(i, false);
GameTextForPlayer(i, "~r~Arrested!", 3000, 5);
SendClientMessage(i, COLOR_AQUA, "You have been arrested by a Undercover FBI Agent.");
GameTextForPlayer(playerid,"~w~Suspect ~g~Arrested.",5000,5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
new pay = random(10000) + 5000;
GivePlayerCash(playerid, pay);
PlayerInfo[playerid][pTakedowns] ++;
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.1, 0, 1, 1, 1, 1);
format(fstr, sizeof(fstr), "%s (%d) has been arrested by a Undercover FBI Agent.", GetName(i), i);
SendClientMessageToAll(COLOR_AQUA, fstr);
SetPlayerScore(i, GetPlayerScore(i) - 1);
SetPlayerSpecialAction(i, SPECIAL_ACTION_HANDSUP);
SetTimerEx("SendPlayerToJail", 2000, false, "d", i);
HasBeenArrested{i} = true;
break;
}
else if(GetTeam{playerid} == CLASS_ARMY)
{
PlayerInfo[i][pArrests] ++;
TogglePlayerControllable(i, false);
GameTextForPlayer(i, "~r~Arrested!", 3000, 5);
SendClientMessage(i, COLOR_AQUA, "You have been arrested by a Army Soldier.");
GameTextForPlayer(playerid,"~w~Suspect ~g~Arrested.",5000,5);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
new pay = random(10000) + 5000;
GivePlayerCash(playerid, pay);
PlayerInfo[playerid][pTakedowns] ++;
ApplyAnimation(playerid, "ped", "ARRESTgun", 4.1, 0, 1, 1, 1, 1);
format(fstr, sizeof(fstr), "%s (%d) has been arrested by a Army Soldier.", GetName(i), i);
SendClientMessageToAll(COLOR_AQUA, fstr);
SetPlayerScore(i, GetPlayerScore(i) - 1);
SetPlayerSpecialAction(i, SPECIAL_ACTION_HANDSUP);
SetTimerEx("SendPlayerToJail", 2000, false, "d", i);
HasBeenArrested{i} = true;
break;
}
}
}
}
}
}
}
}
if(rangepass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
else if(wantedpass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
else if(vehiclepass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
else if(dutypass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
else if(eventpass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
else if(arrestpass == 0)
{
SendClientMessage(playerid, RED, "No wanted players in range.");
}
new astring[100];
format(astring, sizeof(astring),"%s (%d) typed: /ar", GetName(playerid), playerid);
SendAdmin1Message(GREY, astring);
return true;
}