15.12.2010, 21:24
New IRC admin commands,if you use Incognito IRC Plugin,here is a new list of fresh commands for your echo channel!
Code:
IRCCMD:say(botid, channel[], user[], host[], params[]) { // Check if the user has at least voice in the channel if (IRC_IsVoice(botid, channel, user)) { // Check if the user entered any text if (!isnull(params)) { new msg[128]; // Echo the formatted message format(msg, sizeof(msg), "02* Admin %s on IRC: %s", user, params); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC: %s", user, params); SendClientMessageToAll(0x9D000096, msg); } } return 1; } 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 not 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], name[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, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* %s has been kicked by IRC Admin %s. Reason: %s.", name, user, reason); SendClientMessageToAll(0x9D000096, msg); Kick(playerid); } } return 1; } // New Unfreeze cmd IRCCMD:unfreeze(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has been unfrozen by %s on IRC.", name, user); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC has unfrozen %s ",user, name); SendClientMessageToAll(0x9D000096, msg); TogglePlayerControllable(playerid, 1); } } return 1; } // New freeze cmd IRCCMD:freeze(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has been frozen by %s on IRC.", name, user); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC has frozen %s ",user, name); SendClientMessageToAll(0x9D000096, msg); TogglePlayerControllable(playerid, 0); } } return 1; } // New spawn cmd IRCCMD:spawn(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has been respawned by %s on IRC.", name, user); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC has respawned %s ",user, name); SendClientMessageToAll(0x9D000096, msg); TogglePlayerControllable(playerid, 1); } } return 1; } // New disarm cmd IRCCMD:disarm(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has disarmed %s from IRC.", user, name); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC has disarmed you. ",user); SendClientMessage(playerid, 0x9FB1EEAA, msg); ResetPlayerWeapons(playerid); } } return 1; } // New PM cmd IRCCMD:pm(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message and ban the user GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has sent a PM to %s from IRC. (%s)", user, name); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* PM from Admin %s on IRC: %s.", user, reason); SendClientMessage(playerid, 0x9FB1EEAA, msg); } } return 1; } IRCCMD:quarantine(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 not 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], name[MAX_PLAYER_NAME]; // Echo the formatted message and ban the user GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has put %s in quarantine from IRC.", user, name); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* Admin %s on IRC has put %s in quarantine.", user, name); SendClientMessage(playerid, 0x9D000096, msg); SetPlayerPos(playerid,-221.059051,1408.984008,27.773437); SetPlayerInterior(playerid,18); SetPlayerVirtualWorld(playerid,20); TogglePlayerControllable(playerid, 0); } } 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 not 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], name[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, name, sizeof(name)); format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason); IRC_GroupSay(gGroupID, channel, msg); format(msg, sizeof(msg), "* %s has been banned by Admin %s on IRC. Reason: %s.", name, user, reason); SendClientMessageToAll(0x9D000096, msg); BanEx(playerid, reason); } } return 1; } IRCCMD:rcon(botid, channel[], user[], host[], params[]) { // Check if the user is at least an op in the channel if (IRC_IsOp(botid, channel, user)) { // Check if the user entered any text if (!isnull(params)) { // Check if the user did not enter any bad commands if (strcmp(params, "exit", true) != 0 && strcmp(params, "reloadfs irc", true) != 0) { // Echo the formatted message and send the command new msg[128]; format(msg, sizeof(msg), "RCON command %s has been executed.", params); IRC_GroupSay(gGroupID, channel, msg); SendRconCommand(params); } } } return 1; }