[pawn] else if(strcmp(cmd, "sus", true) == 0)
{
new tmp2[256]; new fbil[126]; fbil = dini_Get(file, "FBI"); new plr; plr = FindPlayerIDFromString(tmp);
tmp = strtok(cmdtext, idx), tmp2 = strrest(cmdtext, idx);
if(PlayerInfo[playerid][Cop] == 0 && strval(fbil) < 2) SendClientMessage(playerid, RED, "Only FBI Agent+ or a police officer can suspect!");
else if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, RED, "You have to be logged in first!");
else if(!strlen(tmp2)) SendClientMessage(playerid, RED, "USAGE: /c sus(pect) [id/name] [reason]");
else if(!IsPlayerConnected(plr)) SendClientMessage(playerid, RED, "Target ID not found");
else
{
format(szMsg, 256, "%s has been suspected by %s for %s", gPlayers[plr], gPlayers[playerid], tmp2);
SendClientMessageToAll(GREEN, szMsg);
PlayerInfo[plr][Wanted] = 1;
}
return 1;
}
else if (strcmp(cmd, "wanted", true) == 0)
{
new Count,i,name[24],string[256];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[playerid][Wanted] > 0) Count++;
if(!Count) return SendClientMessageToAll(BLUE,"No Wanted Players");
if(Count == 1)
{
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[playerid][Wanted] > 0) break;
GetPlayerName(i,name,24);
format(string,256,"Wanted Players: %s[%d]",name,PlayerInfo[Wanted]);
return SendClientMessageToAll(BLUE,string);
}
if(Count >= 1)
{
new bool:First = false;
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[playerid][Wanted] > 0) {
GetPlayerName(i,name,24);
if(!First)
{
format(string,256,"Wanted Players: %s[%d],",name,PlayerInfo[Wanted]);
First = true;
}
else format(string,256,"%s, %s[%d]",string,name,PlayerInfo[Wanted]);
}
return SendClientMessageToAll(BLUE,string);
}
return 1;
}[/pawn]
Server crashes when I use the /c wanted command.