loop all online names
#6

this is how i do it
pawn Код:
if (strcmp("/iplist", cmdtext, true) == 0){
        if(Spieler[playerid][AdminLevel] == 0)return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
        SendClientMessage(playerid, COLOUR_GOOD, "Players Online:");
        new x;
new String[128],name[MAX_PLAYER_NAME];
        for(new i; i < MAX_PLAYERS; i++){
            if(!IsPlayerConnected(i))continue;
           
            GetPlayerName( i, name, MAX_PLAYER_NAME);
            format(String, 128, "%s%s(%d)", String,name,i);
            x++;
            if(x > 4) {
                SendClientMessage(playerid, 0xABCDEEFF, String);
                x = 0;
                format(String, 128, "");
            }
            else {
                format(String, 128, "%s, ", String);
            }

        }
        if(x <= 4 && x > 0) {
            String[strlen(String)-2] = '.';
            SendClientMessage(playerid, 0xABCDEEFF, String);
        }
        return 1;
    }
5 names per line
Reply


Messages In This Thread
loop all online names - by BlackWolf120 - 27.02.2011, 01:23
Re: loop all online names - by admantis - 27.02.2011, 01:25
AW: loop all online names - by BlackWolf120 - 27.02.2011, 01:28
Re: loop all online names - by Retardedwolf - 27.02.2011, 01:38
AW: loop all online names - by BlackWolf120 - 27.02.2011, 01:42
Re: loop all online names - by (SF)Noobanatior - 27.02.2011, 04:13

Forum Jump:


Users browsing this thread: 6 Guest(s)