Don't show admin names
#9

Quote:
Originally Posted by Sime30
Посмотреть сообщение
Do you have something like this on top ?
pawn Код:
#define ForEach(%0,%1) \
    for(new %0; %0 != %1; %0++) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))
IF YES ,TRY THIS!

pawn Код:
CMD:admins(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
                new string[256];
                new sendername[MAX_PLAYER_NAME];
            SendClientMessage(playerid, COLOR_GREEN, "__________Admins__________");
            foreach (Player, i)
            {
                if(APlayerData[i][PlayerLevel] >= 1 && APlayerData[i][PlayerLevel] < 1339)
                {
                    new admtext[256];
                    if(APlayerData[i][PlayerLevel] == 1338) { admtext = "Owner"; }
                    else if(APlayerData[i][PlayerLevel] == 1337) { admtext = "1337"; }
                    else if(APlayerData[i][PlayerLevel] == 5) { admtext = "5"; }
                    else if(APlayerData[i][PlayerLevel] == 4) { admtext = "4"; }
                    else if(APlayerData[i][PlayerLevel] == 3) { admtext = "3"; }
                    else if(APlayerData[i][PlayerLevel] == 2)   { admtext = "2"; }
                    else if(APlayerData[i][PlayerLevel] == 1) { admtext = "1"; }
                    else { admtext = "1"; }
                    GetPlayerName(i, sendername, sizeof(sendername));
                    format(string, 256, "{F81414}Admin: {FFFFFF}%s | {48E31C}Level: {FFFFFF}%s", sendername, admtext);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                    }

                }
            }
        }
        return 1;
    }
Why the hell is admtext 256 cells in length when it only contains one or two characters? It should be 32 cells long at the MOST.

Don't be using this guy's code. It is poorly done and will lag your server. (Inefficient code means an iniffecient server.)
Reply


Messages In This Thread
Don't show admin names - by DerickClark - 26.01.2013, 22:42
Re: Don't show admin names - by Sime30 - 26.01.2013, 23:17
Re: Don't show admin names - by DerickClark - 26.01.2013, 23:25
Re: Don't show admin names - by Sime30 - 26.01.2013, 23:33
Re: Don't show admin names - by DerickClark - 26.01.2013, 23:35
Re: Don't show admin names - by SchurmanCQC - 26.01.2013, 23:41
Re: Don't show admin names - by DerickClark - 26.01.2013, 23:44
Re: Don't show admin names - by Sime30 - 26.01.2013, 23:45
Re: Don't show admin names - by SchurmanCQC - 26.01.2013, 23:49
Re: Don't show admin names - by Sime30 - 26.01.2013, 23:51

Forum Jump:


Users browsing this thread: 1 Guest(s)