IRCCMD:kick(botid, channel[], user[], host[], params[]) {
// Check if the user is at least a halfop in the channel
if (IRC_IsHalfop(botid, channel, user)) {
new playerid, reason[64];
// If the user did enter a player ID, then the command will not be processed
if (sscanf(params, "dz", playerid, reason)) {
return 1;}
// If the player is not connected, then nothing will be done
if (IsPlayerConnected(playerid)) {
new msg[128], playname[MAX_PLAYER_NAME];
// If no reason is given, then "No reason" will be stated
if (isnull(reason)) {
format(reason, sizeof(reason), "No reason");}
// Echo the formatted message and kick the user
GetPlayerName(playerid, playname, sizeof(playname));
format(msg, sizeof(msg), "04*** %s has been kicked by %s on IRC. (%s)", playname, user, reason);
Say(channel,msg);
format(msg, sizeof(msg), "*** %s has been kicked by %s on IRC. (%s)", playname, user, reason);
SendMessageToAll(COLOR_RED, msg);
Kick(playerid);}}
return 1;}
IRCCMD:ban(botid, channel[], user[], host[], params[])
{
// Check if the user is at least an op in the channel
if (IRC_IsOp(botid, channel, user))
{
new playerid, reason[64];
// If the user did enter a player ID, then the command will not be processed
if (sscanf(params, "dz", playerid, reason))
{
return 1;
}
// If the player is not connected, then nothing will be done
if (IsPlayerConnected(playerid))
{
new msg[128], playname[MAX_PLAYER_NAME];
// If no reason is given, then "No reason" will be stated
if (isnull(reason))
{
format(reason, sizeof(reason), "No reason");
}
// Echo the formatted message and ban the user
GetPlayerName(playerid, playname, sizeof(playname));
format(msg, sizeof(msg), "04*** %s has been banned by %s on IRC. (%s)", playname, user, reason);
Say(channel,msg);
format(msg, sizeof(msg), "*** %s has been banned by %s on IRC. (%s)", playname, user, reason);
SendMessageToAll(COLOR_RED, msg);
BanEx(playerid, reason);
}
}
return 1;
}
IRCCMD:say(botid, channel[], user[], host[], params[]) {
new msg1[256], msg2[256],string[128];
if(IRC_IsOp(botid, channel, user)) {
format(msg1, sizeof(msg1), "2* Admin %s (IRC): %s", user, params);
Say(channel,string);
format(msg2, sizeof(msg2), "* Admin %s (IRC): %s", user, params);
SendClientMessageToAll(orange, msg2);}
else if(IRC_IsHalfop(botid, channel, user)) {
format(msg1, sizeof(msg1), "2* Mod %s (IRC): %s", user, params);
Say(channel,string);
format(msg2, sizeof(msg2), "* Mod %s (IRC): %s", user, params);
SendClientMessageToAll(orange, msg2);}
else if(IRC_IsVoice(botid, channel, user)) {
format(msg1, sizeof(msg1), "2* Guest %s (IRC): %s", user, params);
Say(channel,string);
format(msg2, sizeof(msg2), "* Guest %s (IRC): %s", user, params);
SendClientMessageToAll(orange, msg2);}
return 1;}
ICMD:players( botid, channel[], user[], host[], params[] )
{
new tempstr[128], string[200], count, name[24];
for( new i ,slots = GetMaxPlayers(); i < slots; i++ )
{
if( IsPlayerConnected(i) )
{
count++;
GetPlayerName( i, name, sizeof(name) );
format( tempstr, sizeof(tempstr), "%s , %s", tempstr, name );
}
}
if( count )
{
format( string, sizeof(string), "Connected Players[%d/%d]:- %s", count, GetMaxPlayers(), tempstr);
IRC_Say( botid, channel, string );
}else IRC_Say( botid, channel, "No Player Online" );
return 1;
}
Cmds For Half OP : !players !kick ...
Thank You Both But Ironboy Kick,ban,Say Are in IRC filterscript!
NicoBoy , I was looking for That, Thanks How can i Set My Bot That Give anyOne who Join Channel Voice (+V)? And How To Add !CMDS ? Like: Код:
Cmds For Half OP : !players !kick ... |
IRCCMD:cmds(botid, channel[], user[], host[], params[])
{
if(!IRC_IsHalfOp(botid, channel, user))
{
IRC_ReplyCTCP(botid, user, "!players");
}
else
{
IRC_ReplyCTCP(botid, user, "!kick [id] [reason]");
}
return true;
}