All pastes #626503 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-07-19 18:21 UTC
rendered paste body
irccmd_kick(conn,  channel[], user[],  params[]) // supports kicking by partial nickname
{
	if (!ircIsOp(conn,channel,user)) return false;
	printinfo
	new strname[16];
	new strmessage[64];
	for (new a=0; a<=MAX_PLAYERS; a++)
	{
	    if (IsPlayerConnected(a))
	    {
			GetPlayerName(a,strname,16);
			new space = (strfind(strname, params));
			if (space != -1)
			{
				Kick(a);
				format(strmessage, sizeof(strmessage), "4*** %s has been kicked by Administrator %s from IRC.", strname, user);
				SendClientMessageToAll(0xFFFFFFFF, strmessage);
				ircSay(conn,channel,strmessage);
				return true;
			}
		}
 	}
 	format(strmessage, sizeof(strmessage), "4*** %s is not found on the server.", params);
 	ircSay(conn,channel,strmessage);
	return true;
}