View Single Post
Old 07/12/2010, 04:18 AM   #66
__
Huge Clucker
 
__'s Avatar
 
Join Date: Nov 2010
Location: London, UK
Posts: 235
Reputation: 20
Default Re: Script Request Thread #5

Quote:
Originally Posted by [NWA]Hannes View Post
Hello, I need a IRC "!players" command that shows the players connected on the sa-mp server.
Making a new row for evry player thats connected, like if 5 players is connected it will show like this:


It shows the players Id within curly bracers, then the players Name, and then the players IP within bracers.

Thanks in advance, [NWA]Hannes.
I apologize for the late response.

You're going to have to use Incognito's IRC plugin for this, here is the code:

Code:
/*#include <a_samp>
#include <irc>

Had to clarify it compiled. */

IRCCMD:command(botid, channel[], user[], host[], params[])
{
	new szPlayerName[MAX_PLAYER_NAME], szPlayerIP[19], szFormatText[128];
	    
    for(new i_iterator = 0; i_iterator < MAX_PLAYERS; i_iterator++) {
        if(IsPlayerConnected(i_iterator)) {
			GetPlayerName(i_iterator, szPlayerName, sizeof(szPlayerName));
			GetPlayerIp(i_iterator, szPlayerIP, sizeof(szPlayerIP));
			format(szFormatText, sizeof(szFormatText), "[%d] %s (%s)", i_iterator, szPlayerName, szPlayerIP);
			IRC_Say(1, "#channel", szFormatText); // Replace 1 with your botid. Replace "#channel" with your IRC channel.
		}
    }
}

Untested.
__ is offline