Hey
Warum wird der Verbrecher nicht arrested.
if(strcmp("/arrest", cmd, true) == 0)
{
if(!IsPlayerConnected(playerid)) return 1;
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist kein Polizist / FBI Agent Soldier !");
if(OnDuty[playerid] != 1) return SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist nicht im Dienst!");
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
moneys = strval(tmp);
if(moneys < 1 || moneys > 200000) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Gefängnispreis kann nur zwischen $1 und $200000 liegen!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Kaution kann nur mit 0 oder 1 festgelegt werden!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /arrest [Preis] [Kaution (0=Nein 1=Ja)] [Kautionspreis]");
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 100000000) { SendClientMessage(playerid, COLOR_ERRORTEXT, " Gefängnis Kaution kann nur zwischen $0 und $100.000.000 liegen!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(!IsPlayerConnected(suspect)) return 1;
if(GetDistanceBetweenPlayers(playerid,suspect) >= 5) return SendClientMessage(playerid, COLOR_ERRORTEXT, " Niemand ist in deiner Nähe den du einsperren kannst !");
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[suspect][pWantedLevel] < 1) return SendClientMessage(playerid, COLOR_ERRORTEXT, " Der Spieler muss mindestens Wanted Level 1 haben!");
format(string, sizeof(string), "* Du hast %s eingesperrt!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new SteuerkasseMoney = moneys;
GivePlayerMoneys(playerid, moneys/2); StuffInfo[sSteuerkasse] += SteuerkasseMoney/2; StuffInfo[sEinnahmen] += SteuerkasseMoney/2;
format(string, sizeof(string), "Eingesperrt von %s ~n~fuer $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapon(suspect);
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
format(string, sizeof(string), "<< FBI Agent %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
format(string, sizeof(string), "<< LSPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
format(string, sizeof(string), "<< SFPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "<< LVPD Officer %s hat den Verdächtigen %s eingesperrt >>", sendername, giveplayer);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
if(PlayerToPoint(6.0, playerid, 1564.9000,-1694.2292,5.8906))
{
PlayerInfo[suspect][pJailed] = 1;
SetPlayerInterior(suspect, 3);
SetPlayerPos(suspect,198.8241,161.8588,1003.0300);
}
if(PlayerToPoint(6.0, playerid, 268.5258,77.6269,1001.0391) || PlayerToPoint(6.0, playerid, 268.4561,84.9885,1001.0391) || PlayerToPoint(6.0, playerid, 321.8767,314.1259,999.1484))
{
PlayerInfo[suspect][pJailed] = 3;
SetPlayerInterior(suspect, 6);
new zufall = random(3);
if(zufall == 1) SetPlayerPos(suspect, 264.3521,82.2144,1001.0391);
else if(zufall == 2) SetPlayerPos(suspect, 264.1788,86.7012,1001.0391);
else SetPlayerPos(suspect, 264.7485,77.6824,1001.0391);
PlayerInfo[suspect][pLocal] = -1;
}
PlayerInfo[suspect][pJailTime] = GetPlayerWantedLevel(playerid) * 60 * 4;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: $%d", PlayerInfo[suspect][pJailTime]/60, JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Du wurdest für %d Minuten eingesperrt. Kaution: Unmöglich", PlayerInfo[suspect][pJailTime]/60);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
SetPlayerFree(suspect, playerid, string, 0);
PlayerInfo[suspect][pArrested] += 1;
PlayerInfo[suspect][pWantedLevel] = 0;
PlayerInfo[suspect][pArrestTime] += GetPlayerWantedLevel(playerid) * 60 * 4;
WantLawyer[suspect] = 1;
format(string,sizeof(string),"%s hat den Verdächtigen %s eingesperrt", sendername, giveplayer);
EnterToLog("arrest",string);
return 1;
}