/admins Bug
#1

When I type /admins it comes up like this, Say 3 people on the server and one admin

Admins online
Server moderater
Admins online
Admins online

Comes up 3 times because 3 players are online, Anyone can help please?

pawn Код:
if(strcmp(cmd, "/admins", true) == 0) {
                 new adminname[24];
                 new admins = 0;
                 new string[256];
                         for(new i = 0; i < MAX_PLAYERS; i++)
                         if (IsPlayerConnected(i)) {
        {
        SendClientMessage(playerid, 0xFFFFFFFF,"Currently online admins:");
                         if(PlayerInfo[i][AdminLevel] == 1 && toggleadmin[i] == 0)
{
            GetPlayerName(i, adminname, 24);
            format(string,sizeof string,"%s - Server Moderator (Level 1)", adminname);
            SendClientMessage(playerid,0xFFFFFFFF,string);
            admins++;
}
                         if(PlayerInfo[i][AdminLevel] == 2 && toggleadmin[i] == 0)
{
                        GetPlayerName(i, adminname, 24);
            format(string,sizeof string,"%s - Moderator + (Level 2)", adminname);
            SendClientMessage(playerid,0xFFFFFFFF,string);
            admins++;
}
                         if(PlayerInfo[i][AdminLevel] == 3 && toggleadmin[i] == 0)
{
                        GetPlayerName(i, adminname, 24);
            format(string,sizeof string,"%s - Admin (Level 3)", adminname);
            SendClientMessage(playerid,0xFFFFFFFF,string);
            admins++;
}
                         if(PlayerInfo[i][AdminLevel] == 4 && toggleadmin[i] == 0)
{
                        GetPlayerName(i, adminname, 24);
            format(string,sizeof string,"%s - Admin + (Level 4)", adminname);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            admins++;
}
Reply
#2

Sorry people why was this moved its a bug :/
Reply
#3

Because this is scripting related.
You should place the "SendClientMessage(playerid, 0xFFFFFFFF,"Currently online admins:");" out of the loop
Reply
#4

Didnt work
Reply
#5

pawn Код:
if(strcmp(cmd, "/admins", true) == 0)
{
    new adminname[24];
    new admins = 0;
    new string[256];
    SendClientMessage(playerid, 0xFFFFFFFF,"Currently online admins:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if(PlayerInfo[i][AdminLevel] == 1 && toggleadmin[i] == 0)
            {
                GetPlayerName(i, adminname, 24);
                format(string,sizeof string,"%s - Server Moderator (Level 1)", adminname);
                SendClientMessage(playerid,0xFFFFFFFF,string);
                admins++;
            }
            if(PlayerInfo[i][AdminLevel] == 2 && toggleadmin[i] == 0)
            {
                GetPlayerName(i, adminname, 24);
                format(string,sizeof string,"%s - Moderator + (Level 2)", adminname);
                SendClientMessage(playerid,0xFFFFFFFF,string);
                admins++;
            }
            if(PlayerInfo[i][AdminLevel] == 3 && toggleadmin[i] == 0)
            {
                GetPlayerName(i, adminname, 24);
                format(string,sizeof string,"%s - Admin (Level 3)", adminname);
                SendClientMessage(playerid,0xFFFFFFFF,string);
                admins++;
            }
            if(PlayerInfo[i][AdminLevel] == 4 && toggleadmin[i] == 0)
            {
                GetPlayerName(i, adminname, 24);
                format(string,sizeof string,"%s - Admin + (Level 4)", adminname);
                SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
                admins++;
            }
        }
    }
    return 1;
}
Reply
#6

Now it just says No Admins Online!

Edit: I deleted my /toggleadmins and it just does the normal :/
Reply
#7

*bump* srs need help
Reply
#8

Then, you need to rcon login.
Reply
#9

What?
Reply
#10

What is the problem now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)