if(strcmp(cmdtext, "/ignorelist",true) == 0 || strcmp(cmdtext, "/il",true) == 0)
{
SendClientMessage(playerid, 0x2641FEAA, "Ignoring:");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(MyIgnoredPlayers[playerid][i] >= 1)
{
GetPlayerName(i,playername,sizeof(playername));
format(string, sizeof(string), "%s (%d)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "No One.");
return 1;
}
}
return 1;
}
if(!strcmp(cmdtext,"/il",true)||!strcmp(cmdtext,"/ignorelist",true))
{
new count=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(MyIgnoredPlayers[playerid][i] >= 1)
{
count++;
GetPlayerName(i,playername,sizeof(playername));
format(string, sizeof(string), "%s (%d)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
else SendClientMessage(playerid, COLOR_RED, "No One.");
}
if(!count) return SendClientMessage(playerid, COLOR_RED, "No One.");
return true;
}
if(!strcmp(cmdtext,"/il",true)||!strcmp(cmdtext,"/ignorelist",true))
{
new count=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(MyIgnoredPlayers[playerid][i] >= 1)
{
count++;
GetPlayerName(i,playername,sizeof(playername));
format(string, sizeof(string), "%s (%d)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
}
if(!count) return SendClientMessage(playerid, COLOR_RED, "No One.");
return true;
}
if(!strcmp(cmdtext,"/il",true)||!strcmp(cmdtext,"/ignorelist",true))
{
new count=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(MyIgnoredPlayers[playerid][i] >= 1)
{
GetPlayerName(i,playername,sizeof(playername));
format(string, sizeof(string), "%s (%d)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "No One.");
return 1;
}
}
return 1;
}
if(!strcmp(cmdtext, "/ignorelist",true) || !strcmp(cmdtext, "/il",true)) { SendClientMessage(playerid, 0x2641FEAA, "Ignoring:"); new count; for(new i=0; i<GetMaxPlayers(); i++) { if(MyIgnoredPlayers[playerid][i] >= 1) { GetPlayerName(i,playername,sizeof(playername)); format(string, sizeof(string), "%s (%d)", playername, i); SendClientMessage(playerid, 0xFFFFFFAA, string); count++; } } if(!count) SendClientMessage(playerid, COLOR_RED, "No One."); return 1; }
if(!strcmp(cmdtext,"/ignorelist",true)||!strcmp(cmdtext,"/il",true))
{
new count;
SendClientMessage(playerid, 0xFFFFFFAA, "Ignoring:");
for(new i=0;i<GetMaxPlayers();i++){
if(MaxIgnoredPlayers[playerid][i] >= 1){
if(count == 0) count = 1;
GetPlayerName(i, playername, sizeof playername);
format(string, sizeof string, "%s (%i)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
}
if(count == 0) SendClientMessage(playerid, 0xFFFFFFAA, "No one.");
return true;
}
Originally Posted by Weirdosport
Why involve a variable at all? My solution = no variable necessary, and it's most in keeping with what he originally posted..
|
if(strcmp(cmdtext, "/ignorelist", true) == 0 || strcmp(cmdtext, "/il", true) == 0)
{
SendClientMessage(playerid, 0x2641FEAA, "Ignoring:");
string[0] = 0; //just for make sure that it works... not necessary if some factors are existing
for(new i; i < MAX_PLAYERS; i++)
if(MyIgnoredPlayers[playerid][i] >= 1)
{
GetPlayerName(i, playername, sizeof(playername));
format(string, sizeof(string), "%s (%d)", playername, i);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
if(!string[0]) SendClientMessage(playerid, COLOR_RED, "No One.");
return true;
}