03.07.2011, 15:08
Hello guys.
I made a /admins command, and it works just perfect when admins are online.
But when there are no admins online, its a little bit buggy. When no admins are online, its supposed to send this message: "No admins online at the moment" but it shows up multiple times.
Here is the command:
Hope you can help me. Thank you.
I made a /admins command, and it works just perfect when admins are online.
But when there are no admins online, its a little bit buggy. When no admins are online, its supposed to send this message: "No admins online at the moment" but it shows up multiple times.
Here is the command:
pawn Код:
COMMAND:admins(playerid, params[])
{
SendClientMessage(playerid, COLOR_SYSTEMRED, "=========== Online Admins ===========");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdminLevel] >= 1)
{
new name[MAX_PLAYER_NAME], string[21 + MAX_PLAYER_NAME];
GetPlayerName(i,name,sizeof(name));
format(string, sizeof(string), "(Level:%i) %s (ID:%i)", PlayerInfo[i][pAdminLevel], name, i);
SendClientMessage(playerid, COLOR_SYSTEMRED, string);
}
else if(PlayerInfo[i][pAdminLevel] == 0) SendClientMessage(playerid, COLOR_SYSTEMRED, "No admins online at the moment");
}
}
SendClientMessage(playerid, COLOR_SYSTEMRED, "===================================");
return 1;
}