for loop seems to be stopping the script from progressing.
#1

Uh, hi.. I've the following code:
pawn Код:
CMD:admins(playerid, params[])
{
    new p;
    SendClientMessage(playerid, COLOR_MESSAGE_ONE, "[Server Staff] {ABCBF5}Administrators:");
    for(p = 0; p <= MAX_PLAYERS; p++)
    {
        printf("%d", p);
        if(PlayerInfo[p][AdminLevel] > 0 && IsPlayerConnected(p))
        {
            GetPlayerName(p, pName, sizeof(pName));
            RPName(pName, '_');
            if(PlayerInfo[p][AdminLevel] == 1) format(msg, sizeof(msg), "- Trial Admin %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 2) format(msg, sizeof(msg), "- Basic Admin %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 3) format(msg, sizeof(msg), "- Senior Admin %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 4) format(msg, sizeof(msg), "- Lead Admin %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 5) format(msg, sizeof(msg), "- Head Admin %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 6) format(msg, sizeof(msg), "- Co-owner %s (%d)", pName, p);
            if(PlayerInfo[p][AdminLevel] == 7) format(msg, sizeof(msg), "- Owner %s (%d)", pName, p);
            SendClientMessage(playerid, COLOR_USAGE, msg);
        }
    }
    printf("..");
    SendClientMessage(playerid, COLOR_MESSAGE_ONE, "[Server Staff] {ABCBF5}Helpers:");
    for(p = 0; p <= MAX_PLAYERS; p++)
    {
        if(PlayerInfo[p][Helper] == 1 && IsPlayerConnected(p))
        {
            GetPlayerName(p, pName, sizeof(pName));
            RPName(pName, '_');
            format(msg, sizeof(msg), "- Helper %s (%d)", pName, p);
            SendClientMessage(playerid, COLOR_USAGE, msg);
        }
    }
    return 1;
}
Just saying.. it doesn't reach the second printf, however, it does finish the first one (it reaches 500)
Any idea? I just can't seem to figure it out.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)