if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht im Dienst!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /su [Spieler ID/ Name] [Anzahl] [Verbrechen]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /su [Spieler ID] [Anzahl] [Verbrechen]");
return 1;
}
new WantedAnzahl;
WantedAnzahl = strval(tmp);
if (IsACop(playerid) && OnDuty[playerid] == 1 || PlayerInfo[playerid][pMember] == 1 && FWDuty[playerid] == 1 || PlayerInfo[playerid][pLeader] == 1 && FWDuty[playerid] == 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pJailed] > 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Der Spieler ist im Gefängnis!");
return 1;
}
if (gTeam[giveplayerid] != 2 && !IsACop(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /su [Spieler ID / Name] [Anzahl] [Verbrechen]");
return 1;
}
WantedLevel[giveplayerid] += WantedAnzahl;
if(WantedLevel[giveplayerid] > 0 && WantedLevel[giveplayerid] <= 10)
{
SetPlayerWantedLevel(giveplayerid,0);
}
if(WantedLevel[giveplayerid] > 10 && WantedLevel[giveplayerid] <= 20)
{
SetPlayerWantedLevel(giveplayerid,1);
}
if(WantedLevel[giveplayerid] > 20 && WantedLevel[giveplayerid] <= 30)
{
SetPlayerWantedLevel(giveplayerid,2);
}
if(WantedLevel[giveplayerid] > 30 && WantedLevel[giveplayerid] <= 40)
{
SetPlayerWantedLevel(giveplayerid,3);
}
if(WantedLevel[giveplayerid] > 40 && WantedLevel[giveplayerid] <= 50)
{
SetPlayerWantedLevel(giveplayerid,4);
}
if(WantedLevel[giveplayerid] > 50 && WantedLevel[giveplayerid] <= 60)
{
SetPlayerWantedLevel(giveplayerid,5);
}
if(WantedLevel[giveplayerid] > 60)
{
SetPlayerWantedLevel(giveplayerid,6);
}
format(string, sizeof(string), "Du hast ein Verbrechen begangen ( %s ). Zeuge: %s.",result,sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Vergebene Wanteds: %d. Neues Wantedlevel: %d", WantedAnzahl, WantedLevel[giveplayerid]);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
format(string, sizeof(string), "HQ: Alle Einheiten: Reporter: %s, Vergebene Wanteds: %d",sendername, WantedAnzahl);
SendClientMessage(i, TEAM_BLUE_COLOR, string);
format(string, sizeof(string), "HQ: Verbrechen: %s, Gesuchter: %s, Aktuelle Wanteds: %d",result,giveplayer, WantedLevel[giveplayerid]);
SendClientMessage(i, TEAM_BLUE_COLOR, string);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du kannst keinen Polizisten anklagen!");
}
}
}
else
{
format(string, sizeof(string), "%d ist kein aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Polizist!");
}
}
return 1;
}
Ich hoffe das hilft dir weiter
lg RedAge