Hallo ich habe ein Problem wen ich jemand einsperre kommt
format(spr,sizeof(spr),"Du wurdest für %d Minuten und einer Geldstrafe von %d$ eingesperrt",WantedLevel[suspect] * 4,WantedLevel[suspect] * 2000);
woran kann es liegen? ich bezahl selbst die strafe und der User wird aber trotzdem eingesperrt!
Normals sollte der Spieler die Strafe bezahlen und nicht der Polizist
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,-1589.8398,715.9842,-5.2422) || IsPlayerInRangeOfPoint(playerid,3.0,215.6246,113.8847,999.0156) || IsPlayerInRangeOfPoint(playerid,3.0,1564.6660,-1694.4382,5.8906))
{// 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), "< < < < LSPD 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), "< < < < FBI 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), "< < < < 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), "< < < < SWAT Agent %s hat den Verbrecher %s eingesperrt > > > >", SpielerName(playerid), SpielerName(suspect));
OOCNews(COLOR_RED, string);
}
if(LSPDZellen == 0)//zelle1
{
SetPlayerInterior(suspect, 3);
UnFreezePlayer(playerid);
PlayerCuffed[playerid] = 0;
SetPlayerPos(suspect,227.3844,111.5490,999);
LSPDZellen += 0;
}
if(LSPDZellen == 1)//zelle2
{
SetPlayerInterior(suspect, 3);
UnFreezePlayer(playerid);
PlayerCuffed[playerid] = 0;
SetPlayerPos(suspect,223.5090,111.4179,999);
LSPDZellen += 0;
}
if(LSPDZellen == 2)//zelle3
{
SetPlayerInterior(suspect, 3);
UnFreezePlayer(playerid);
PlayerCuffed[playerid] = 0;
SetPlayerPos(suspect,219.5361,111.3571,999);
LSPDZellen += 0;
}
if(LSPDZellen == 3)//Zelle4
{
SetPlayerInterior(suspect, 3);
UnFreezePlayer(playerid);
PlayerCuffed[playerid] = 0;
SetPlayerPos(suspect,215.5814,111.1412,999);
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, 10);
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;
}
Bisher noch nicht fen fehler gefunden