21.02.2014, 10:22
PHP код:
dcmd_members(playerid, params[])
{
new amount[2], string[200], shortstr[55], pname[24];
SendClientMessage(playerid, 0xFFFFFFFF, "Group members online:");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
amount[0] ++;
amount[1] ++;
GetPlayerName(i, pname, 24);
if(PlayerInfo[playerid][pLeader] != i) format(shortstr, sizeof(shortstr), "%s(%d),", pname, x);
if(PlayerInfo[playerid][pLeader] == i) format(shortstr, sizeof(shortstr), "[LEADER] %s(%d),", pname, x);
if(amount[1] == 1) format(string, sizeof(string), "%s", shortstr);
if(amount[1] != 1) format(string, sizeof(string), "%s %s", string, shortstr);
if(amount[0] == 6)
{
strdel(string, strlen(string)-1, strlen(string));
SendClientMessage(playerid, 0xFFFFFFFF, string);
string = "";
amount[0] = 0;
}
}
}
strdel(string, strlen(string)-1, strlen(string));
if(amount[0] != 0) SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}