Wenn ich /arrest ID mache dann steht da
Du kannst keinen Beamten einsperren!
Aber der ist kein Cop.
Hier ist der Pawn Code:
if(strcmp(cmd, "/arrest", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Dienst!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,6.0, 1564.5873,-1694.4680,5.8906) || IsPlayerInRangeOfPoint(playerid,3.0,268.5958,85.1651,1001.0391) || IsPlayerInRangeOfPoint(playerid,3.0,-1702.6952,1017.9680,17.5859))
{// Jail spot
new suspect = GetClosestPlayer(playerid);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /arrest (ID / Name)");
return 1;
}
if(IsACop(suspect))
{
SendClientMessage(playerid, COLOR_GRAD2, " Du kannst keinen Beamten einsperren!");
return 1;
}
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 ist nicht gesucht!");
return 1;
}
GivePlayerMoney(suspect,-WantedLevel[suspect]*750);
GivePlayerMoney(playerid,WantedLevel[suspect]*750);
PlayerInfo[playerid][pGehalt] += WantedLevel[suspect]*2000;
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "INFO: Officer %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
OOCNews(COLOR_RED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "INFO: Agent %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
OOCNews(COLOR_RED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "INFO: Soldat %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
OOCNews(COLOR_RED, string);
}
else if(PlayerInfo[playerid][pMember]==22||PlayerInfo[playerid][pLeader]==22)
{
format(string, sizeof(string), "INFO: SWAT Agent %s hat den Verbrecher %s eingesperrt", SpielerName(playerid), SpielerName(suspect));
OOCNews(COLOR_RED, string);
}
if(LSPDZellen == 0)//zelle1
{
SetPlayerInterior(suspect, 6);
UnFreezePlayer(suspect);
PlayerCuffed[suspect] = 0;
SetPlayerPos(suspect,264.0306,82.5047,1001.0391);
LSPDZellen += 1;
}
if(LSPDZellen == 1)//zelle2
{
SetPlayerInterior(suspect, 6);
UnFreezePlayer(suspect);
PlayerCuffed[suspect] = 0;
SetPlayerPos(suspect,263.5588,86.7332,1001.0391);
LSPDZellen += 1;
}
if(LSPDZellen == 2)//zelle3
{
SetPlayerInterior(suspect, 6);
UnFreezePlayer(suspect);
PlayerCuffed[suspect] = 0;
SetPlayerPos(suspect,263.5588,86.7332,1001.0391);
LSPDZellen = 0;
}
PlayerInfo[suspect][pJailTime] = WantedLevel[suspect] * 240;
new spr[100];
format(spr,sizeof(spr),"Du wurdest für %d Minuten und einer Geldstrafe von %d$ eingesperrt",WantedLevel[suspect] * 4,WantedLevel[suspect] * 2000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,spr);
PlayerInfo[suspect][pJailed] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerInterior(suspect, 6);
SetPlayerFree(suspect,playerid, "Verhaftet");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
SetPlayerWantedLevel(suspect,0);
}//distance
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niemand zum Verhaften in deiner Nähe.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
return 1;
}
}//not connected
return 1;
}