All pastes #619147 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2007-07-14 14:15 UTC
rendered paste body
if (strcmp(command, ".players", true) == 0){    new players = CurrentPlayers(), string[256];    new playerlist[256] = PlayerList(strval(TextArguments));    format(string, sizeof(string), "Current players on server: %i", players);    ircSay(conn, channel, string);    format(string, sizeof(string), "List of current players: %s", playerlist);	ircSay(conn, channel, string);}stock PlayerList(users) { // Example: PlayerList(30) would show 30 users or PlayerList(MAX_PLAYERS) would show them all	new players[MAX_PLAYERS], playernum = 0;	for(new i = 0; i <= users; i++) { // Loop through	    if(IsPlayerConnected(i)) { // Check if they're connected	        playernum++;	        players[playernum] = PlayerName(i);		 }	}	return players; // Return the array}stock PlayerName(playerid) {	new name[MAX_PLAYER_NAME]; // Make the variable	GetPlayerName(playerid, name, sizeof(name)); // Get the name and save to the variable	return name; // Return the name}