how to show all players in one and multi lines ?
#1

i want show like when u press /players its shows like
player1,playerb,player3
player4,playerc,player5

Код:
dcmd_players(playerid,params[])
{
	#pragma unused params

        new string[128];
		for(new i = 0; i < MAX_PLAYERS; i++)
		{

        if(IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            format(string, sizeof(string), "%s(%d)",PlayerName(i),i);

            SendClientMessage(playerid, 0xFFF84FFFF, string);
        	}
    }
	return 1;
}
but this code its shows like this

player1
playerb
player3
player4
playerc
player5
Reply
#2

Putted this line on up of script ?

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Well I suggest you don't add this , It is useless cause there is already TAB to see all players online.
Reply
#3

pawn Код:
dcmd_players(playerid,params[])
{
    #pragma unused params
    new string[75], count = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            if(count != 2) format(string, sizeof(string), "%s%s,", string, PlayerName(i),i);
            else format(string, sizeof(string), "%s%s", string, PlayerName(i),i);
            count++;
        }
        if(count == 3)
        {
            SendClientMessage(playerid, 0xFFF84FFFF, string);
            count = 0;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)