Hallo Cm.
Ich habe ein Problem, unzwar geht der Befehl /suspect bei mir nicht.
Hier meine Codes:
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(OnDuty[playerid] != 1 && SpielerInfo[playerid][sMember] == 1 && SpielerInfo[playerid][sLeader] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst erst in den Dienst gehen (/duty).");
return 1;
}
if(OnDuty[playerid] != 1 && SpielerInfo[playerid][sMember] == 2 && SpielerInfo[playerid][sLeader] == 2)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst erst in den Dienst gehen (/duty).");
return 1;
}
if(OnDuty[playerid] != 1 && SpielerInfo[playerid][sMember] == 3 && SpielerInfo[playerid][sLeader] == 3)
{
SendClientMessage(playerid, COLOR_GREY, " Du musst erst in den Dienst gehen (/duty).");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Befehl: (/su)spect [playerid] [Anklage]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (gTeam[giveplayerid] != 2)
{
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, "Befehl: (/su)spect [playerid] [Vergehen]");
return 1;
}
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_WHITE, "Du kannst keinem Staatsbeamten Wanteds geben!");
return 1;
}
if(WantedLevel[giveplayerid] >= 6)
{
SendClientMessage(playerid, COLOR_WHITE, "Der Spieler hat schon 6 Wanteds!");
return 1;
}
WantedLevel[giveplayerid]+= 1;
SetPlayerCriminal(giveplayerid,playerid, result);
SendClientMessage(playerid, COLOR_WHITE, "Du hast dem Spieler ein WantedLevel gegeben!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du kannst keinem Beamten ein WantedLevel geben!");
}
}
}
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 Staatsbeamter !");
}
}
return 1;
}
public SetPlayerCriminal(playerid,declare,reason[])
{
if(IsPlayerConnected(playerid))
{
SpielerInfo[playerid][pCrimes] += 1;
new points = WantedPoints[playerid];
new turned[MAX_PLAYER_NAME];
new turner[MAX_PLAYER_NAME];
new turnmes[128];
new wantedmes[128];
new wlevel;
strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
GetPlayerName(playerid, turned, sizeof(turned));
if (declare == 255)
{
format(turner, sizeof(turner), "Anonym");
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
}
else
{
if(IsPlayerConnected(declare))
{
GetPlayerName(declare, turner, sizeof(turner));
strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
strmid(PlayerCrime[declare][pBplayer], turned, 0, strlen(turned), 255);
strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
}
}
format(turnmes, sizeof(turnmes), "Du hast ein Verbrechen begangen ( %s ). Reporter: %s.",reason,turner);
SendClientMessage(playerid, COLOR_LIGHTRED, turnmes);
if(points > 0)
{
new yesno;
if(points == 2) { if(WantedLevel[playerid] < 1) { WantedLevel[playerid] = 1; wlevel = 1; SetPlayerWantedLevel(playerid, 1); yesno = 1; } }
else if(points >= 4 && points <= 5) { if(WantedLevel[playerid] < 2) { WantedLevel[playerid] = 2; wlevel = 2; SetPlayerWantedLevel(playerid, 2); yesno = 1; } }
else if(points >= 6 && points <= 7) { if(WantedLevel[playerid] < 3) { WantedLevel[playerid] = 3; wlevel = 3; SetPlayerWantedLevel(playerid, 3); yesno = 1; } }
else if(points >= 8 && points <= 9) { if(WantedLevel[playerid] < 4) { WantedLevel[playerid] = 4; wlevel = 4; SetPlayerWantedLevel(playerid, 4); yesno = 1; } }
else if(points >= 10 && points <= 11) { if(WantedLevel[playerid] < 5) { WantedLevel[playerid] = 5; wlevel = 5; SetPlayerWantedLevel(playerid, 5); yesno = 1; } }
else if(points >= 12 && points <= 13) { if(WantedLevel[playerid] < 6) { WantedLevel[playerid] = 6; wlevel = 6; SetPlayerWantedLevel(playerid, 6); yesno = 1; } }
if(WantedLevel[playerid] >= 1) { if(gTeam[playerid] == 3) { gTeam[playerid] = 4; } }
if(yesno)
{
format(wantedmes, sizeof(wantedmes), "Momentanes Wanted Level: %d", wlevel);
SendClientMessage(playerid, COLOR_YELLOW, wantedmes);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i))
{
format(cbjstore, sizeof(turnmes), "HQ: Alle Einheiten: Reporter: %s",turner);
SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
format(cbjstore, sizeof(turnmes), "HQ: Verbrechen: %s, Gesuchter: %s",reason,turned);
SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
}
}
}
}
}
}
}
Die Message bekommt zwar der Spielen dem cih die WPS gegeben habe, Also bei dem wird dieses Text hier angezeigt Du hast ein Verbrechen begangen ( %s ). Reporter: %s. Aber der Spieler bekommt die Wanteds nicht Also die Sterne, wen ich ihn einknasten möchte Landet der auch im Knast...