if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/a1", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst!");
return 1;
}
if(!PlayerToPoint(6.0, playerid, xxx) || PlayerToPoint(6.0, playerid, xxx) || PlayerToPoint(6.0, playerid, xxx))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht in der nähe des Gefängnisses!");
return 1;
}
if(PlayerToPoint(6.0, playerid, xxx) || PlayerToPoint(15.0, playerid,xxx) || PlayerToPoint(6.0, playerid, xxxx))
{
tmp = strtok(cmdtext, idx);
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "* /a(rrest) [Kosten] [Minuten] [Kaution (0 = nein || 1 = ja)] [Kautionspreis]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " Jail Price can't be below $1 or above $99999 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "* /a(rrest) [Kosten] [Minuten] [Kaution (0 = nein || 1 = ja)] [Kautionspreis]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, " Knastzeit muss zwischen 1 und 60 Minuten(Für mehr Minuten gibts Prison) !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "* /a(rrest) [Kosten] [Minuten] [Kaution (0 = nein || 1 = ja)] [Kautionspreis]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Kann nur zwischen 0 und 1 liegen !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "* /a(rrest)1 [Kosten] [Minuten] [Kaution (0 = nein || 1 = ja)] [Kautionspreis]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 100000) { SendClientMessage(playerid, COLOR_GREY, " Kaution kann nicht über 100.000$ liegen!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler muss mindestens 1 Wanteds haben!");
return 1;
}
format(string, sizeof(string), "* Du verhaftest %s !", giveplayer);
SendClientMessage(playerid, COLOR_GRAD3, string);
GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Verhaftet %s ~n~ Für $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
SetPlayerWantedLevel(suspect, 0);
if(PlayerInfo[playerid][pMember]== 1 || PlayerInfo[playerid][pLeader]== 1)
{
format(string, sizeof(string), "<< LS Officer %s verhaftet %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]== 2 || PlayerInfo[playerid][pLeader]== 2)
{
format(string, sizeof(string), "<< SF Officer %s %s verhaftet %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]== 21 || PlayerInfo[playerid][pLeader]== 21)
{
format(string, sizeof(string), "<< FBI Agent %s %s verhaftet %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]== 3 || PlayerInfo[playerid][pLeader]== 3)
{
format(string, sizeof(string), "<< Soldat %s %s verhaftet %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Du wurdest eingesperrt für %d Sekunden. Kaution: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_GRAD3, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Du wurdest eingesperrt für %d Sekunden. Kaution: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_GRAD3, string);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time * 60;
PlayerInfo[suspect][pJailed] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Verhaftet");
WantedPoints[giveplayerid] = 0;
WantedLevel[giveplayerid] = 0;
ClearCrime(giveplayerid);
SetPlayerWantedLevel(giveplayerid,0);
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " No-one close enough to arrest.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter!");
return 1;
}
}//not connected
return 1;
}