Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #define CMD_PREFIX "your prefix here" // change this to your need
- #define BOT_CHANNEL "channel name" // change this
- #define BOT_NAME "Your bot name" //change this
- #define CHANNEL_ID "451428906159964160" // change this
- #include <dcc>
- #define COLOR_RED 0xFF0000FF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Discord Console by Inferno");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Discord Console by Inferno");
- print("----------------------------------\n");
- }
- #endif
- forward kicktimer(playerid);
- public kicktimer(playerid)
- {
- Kick(playerid);
- return 1;
- }
- DC_CMD:kick(user, args)
- {
- new id, giveplayer[MAX_PLAYER_NAME], string[64];
- if(sscanf(args,"u[24]",id)) return SendDC(CHANNEL_ID, "```Usage: /kick [playerid]```");
- else if(!IsPlayerConnected(id)) return SendDC(CHANNEL_ID, "**Player is not connected.**");
- GetPlayerName(id, giveplayer, MAX_PLAYER_NAME);
- SendDC(CHANNEL_ID, "```Player %s has been kicked.```", giveplayer);
- format(string, sizeof(string), "%s has been kicked from the server.", giveplayer);
- SendClientMessageToAll(COLOR_RED, string);
- SetTimerEx("kicktimer", 500, false, "i", id);
- return 1;
- }
- DC_CMD:asay(user, args)
- {
- new str[145], message[512];
- if (sscanf(args, "s[512]", message)) return SendDC(CHANNEL_ID, "```Usage: /asay [message]```");
- format(str, sizeof str, "{d80000}Admin [%s]: %s", user, message);
- SendDC(CHANNEL_ID, "```Admin [%s]: %s```", message, user);
- SendClientMessageToAll(-1, str);
- return 1;
- }
- DC_CMD:cmds(user, args)
- {
- SendDC(CHANNEL_ID, "**(Admin Control Panel Commands) Moon**");
- SendDC(CHANNEL_ID, "```cmds, kick, asay, freeze, unfreeze, players```");
- return 1;
- }
- DC_CMD:freeze(user, args)
- {
- new giveplayerid, giveplayer[MAX_PLAYER_NAME];
- if (sscanf(args, "u", giveplayerid)) return SendDC(CHANNEL_ID, "```Usage: /freeze [playerid]```");
- if (!IsPlayerConnected(giveplayerid)) return SendDC(CHANNEL_ID, "**Error: Inactive player id!**");
- TogglePlayerControllable(giveplayerid, 0);
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- SendClientMessage(giveplayerid, COLOR_RED, "You have been frozen by an admin.");
- SendDC(CHANNEL_ID, "``` Player %s has been frozen.```", giveplayer);
- return 1;
- }
- DC_CMD:unfreeze(user, args)
- {
- new giveplayerid, giveplayer[MAX_PLAYER_NAME];
- if (sscanf(args, "u", giveplayerid)) return SendDC(CHANNEL_ID, "```Usage: /unfreeze [playerid]```");
- if (!IsPlayerConnected(giveplayerid)) return SendDC(CHANNEL_ID, "**Error: Inactive player id!**");
- TogglePlayerControllable(giveplayerid, 1);
- GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
- SendClientMessage(giveplayerid, COLOR_RED, "You have been unfrozen by an admin.");
- SendDC(CHANNEL_ID, "``` Player %s has been unfrozen.```", giveplayer);
- return 1;
- }
- DC_CMD:players(user, args)
- {
- new count = 0;
- new name[24];
- SendDC(CHANNEL_ID, "**__Online Players__**");
- for(new i=0; i < MAX_PLAYERS; i++) {
- if(!IsPlayerConnected(i)) continue;
- GetPlayerName(i, name, MAX_PLAYER_NAME);
- {
- SendDC(CHANNEL_ID, "```%s(%d)```", name, i);
- count++; }
- }
- if (count == 0) return SendDC(CHANNEL_ID, "There are no players online.");
- return 1;
- }
Add Comment
Please, Sign In to add comment