2018-09-09 20:55:38 +00:00
|
|
|
/*
|
|
|
|
* Irresistible Gaming (c) 2018
|
2018-12-12 08:21:57 +00:00
|
|
|
* Developed by Lorenc, Stev
|
2018-09-09 20:55:38 +00:00
|
|
|
* Module: cnr/commands/admin/_admin.pwn
|
|
|
|
* Purpose: encloses all admin related commands
|
|
|
|
*/
|
|
|
|
|
2018-09-25 21:06:23 +00:00
|
|
|
/* ** Includes ** */
|
|
|
|
#include < YSI\y_hooks >
|
|
|
|
|
2018-09-09 20:55:38 +00:00
|
|
|
/* ** Definitions ** */
|
|
|
|
#define ADMIN_COMMAND_REJECT "You don't have an appropriate administration level to use this command."
|
|
|
|
#define ADMIN_COMMAND_TIME 4
|
|
|
|
|
2018-09-26 07:01:34 +00:00
|
|
|
/* ** Variables ** */
|
2018-09-25 21:06:23 +00:00
|
|
|
enum E_COMMAND_DATA
|
|
|
|
{
|
2018-12-01 23:17:05 +00:00
|
|
|
E_LEVEL, E_COMMAND[ 64 ], E_DESCRIPTION[ 144 ]
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ** Admin Ban Codes ** */
|
|
|
|
enum E_BAN_CODE
|
|
|
|
{
|
|
|
|
E_CODE[ 4 ], E_DATA[ 21 ]
|
|
|
|
};
|
2018-09-25 21:06:23 +00:00
|
|
|
|
2018-09-26 07:01:34 +00:00
|
|
|
static stock
|
2018-12-01 23:17:05 +00:00
|
|
|
g_commandData [ ] [ E_COMMAND_DATA ] =
|
2018-09-25 21:06:23 +00:00
|
|
|
{
|
|
|
|
/* ** Level 1 Commands ** */
|
|
|
|
{ 1, "/viewdeathmsg", "Viewing a player death message" },
|
|
|
|
{ 1, "/arepair", "Fixing a vehicle" },
|
|
|
|
{ 1, "/aka", "Player name changes (also known as)" },
|
|
|
|
{ 1, "/pinfo", "Related information about a player" },
|
|
|
|
{ 1, "/reports", "Showing the last 8 reports" },
|
|
|
|
{ 1, "/questions", "Showing the last 8 questions" },
|
|
|
|
{ 1, "/respawnalluv", "Respawning all unused vehicles" },
|
|
|
|
{ 1, "/aod", "Admin on Duty mode" },
|
|
|
|
{ 1, "/asay", "Speak as a Admin." },
|
|
|
|
{ 1, "/frules", "Forcing player to view the rules" },
|
|
|
|
{ 1, "/fpc", "Forcing player to view player colors" },
|
|
|
|
{ 1, "/freeze", "Freezing a player" },
|
|
|
|
{ 1, "/unfreeze", "Unfreezing a player" },
|
|
|
|
{ 1, "/awep", "Showing player current weapons" },
|
|
|
|
{ 1, "/alog", "Shows administration log textdraw" },
|
2018-12-23 01:35:17 +00:00
|
|
|
{ 1, "/stopask", "Blocking/unblocking a player from using /ask" },
|
2018-09-25 21:06:23 +00:00
|
|
|
{ 1, "/ans", "Answering a question" },
|
|
|
|
{ 1, "/respond", "Responding to a report" },
|
|
|
|
{ 1, "/aspawn", "Spawning a player" },
|
|
|
|
{ 1, "/warn", "Warning a player" },
|
|
|
|
{ 1, "/setskin", "Setting a player s speific skin ID" },
|
2018-12-23 01:35:17 +00:00
|
|
|
{ 1, "/stopreport", "Blocking/unblocking a player from using /report" },
|
2018-09-25 21:06:23 +00:00
|
|
|
{ 1, "/getstats", "Gettings the stats of a player" },
|
|
|
|
{ 1, "/a", "Admin chat" },
|
|
|
|
{ 1, "/adminmanual", "Reading the admin manual" },
|
|
|
|
{ 1, "/slap", "Slaping a player (default offset = 10)" },
|
|
|
|
{ 1, "/jail", "Jailing a player" },
|
|
|
|
{ 1, "/unjail", "Unjailing a player" },
|
|
|
|
{ 1, "/spec", "Spectating a player" },
|
|
|
|
{ 1, "/specoff", "Turning specation mode off" },
|
|
|
|
{ 1, "/goto", "Teleporting to a player" },
|
|
|
|
{ 1, "/mutelist", "Showing a list of muted players" },
|
|
|
|
|
|
|
|
/* ** Level 2 Commands ** */
|
|
|
|
{ 2, "/slay", "Slaying a player" },
|
|
|
|
{ 2, "/viewnotes", "Viewing a players V.I.P notes" },
|
|
|
|
{ 2, "/suspend", "Suspending a player" },
|
|
|
|
{ 2, "/arenas", "Showing a dialog of arenas for events" },
|
|
|
|
{ 2, "/explode", "Exploding a player" },
|
|
|
|
{ 2, "/vrespawn", "Respawning a vehicle ID" },
|
|
|
|
{ 2, "/vdestroy", "Destroying a admin vehicle" },
|
|
|
|
{ 2, "/mute", "Muting a player" },
|
|
|
|
{ 2, "/unmute", "Unmuting a player" },
|
|
|
|
{ 2, "/kick", "Kicking a player from the server" },
|
|
|
|
|
|
|
|
/* ** Level 3 Commands ** */
|
2018-12-26 10:02:48 +00:00
|
|
|
{ 3, "/banlog", "Finding ban information about a player" },
|
2018-09-25 21:06:23 +00:00
|
|
|
{ 3, "/smlog", "Cash transaction log from a player" },
|
|
|
|
{ 3, "/iclog", "IC transaction log from a player" },
|
|
|
|
{ 3, "/resetwep", "Resetting weapons from a player" },
|
|
|
|
{ 3, "/getip", "Getting IP of a player" },
|
|
|
|
{ 3, "/geolocate", "Geographical location of a player" },
|
|
|
|
{ 3, "/copwarn", "Cop warn a player" },
|
|
|
|
{ 3, "/armywarn", "Army warn a player" },
|
|
|
|
{ 3, "/rcopwarn", "Removing a cop warning" },
|
|
|
|
{ 3, "/rarmywarn", "Removing a army warning" },
|
|
|
|
{ 3, "/forcecoptutorial", "Forcing a player to view the cop tutorial" },
|
|
|
|
{ 3, "/ann", "Creates a global annoucement" },
|
|
|
|
{ 3, "/announce", "Creates a global annoucement" },
|
|
|
|
{ 3, "/aheal", "Healing a player" },
|
|
|
|
{ 3, "/healall", "Healing everyone" },
|
|
|
|
{ 3, "/vadminstats", "Viewing vehicle stats" },
|
|
|
|
{ 3, "/vadminpark", "Parking a vehicle" },
|
|
|
|
{ 3, "/givewep", "Giving a player a weapon" },
|
|
|
|
{ 3, "/giveweapon", "Giving a player a weapon" },
|
|
|
|
{ 3, "/cc", "Clearing the main chat" },
|
|
|
|
{ 3, "/clearchat", "Clearing the main chat" },
|
|
|
|
{ 3, "/vbring", "Bring a vehicle ID to you" },
|
|
|
|
{ 3, "/vgoto", "Teleport to a vehicle ID" },
|
|
|
|
{ 3, "/venter", "Enter a vehicle ID" },
|
|
|
|
{ 3, "/vforce", "Forcing a player to enter vehicle ID" },
|
|
|
|
{ 3, "/hgoto", "Teleport to a house" },
|
|
|
|
{ 3, "/bgoto", "Teleport to a business" },
|
|
|
|
{ 3, "/cd", "Countdown (short)" },
|
|
|
|
{ 3, "/countdown", "Countdown" },
|
|
|
|
{ 3, "/pingimmune", "Making a player immune from ping kicker" },
|
|
|
|
{ 3, "/ban", "Banning a player" },
|
|
|
|
{ 3, "/bring", "Bring a player to you" },
|
|
|
|
|
|
|
|
/* ** Level 4 Commands ** */
|
|
|
|
{ 4, "/destroyallav", "Destroys all admin spawned vehicles" },
|
|
|
|
{ 4, "/event", "Set's your world to 69" },
|
|
|
|
{ 4, "/setworld", "Sets your virtual world" },
|
|
|
|
{ 4, "/setinterior", "Sets your interior ID" },
|
|
|
|
{ 4, "/uncopban", "Unbanning a player from cop class" },
|
|
|
|
{ 4, "/unarmyban", "Unbanning a player from army class" },
|
|
|
|
{ 4, "/motd", "Sets a Message Of The Day" },
|
|
|
|
{ 4, "/resetwepall", "Resets all player weapons" },
|
|
|
|
{ 4, "/giveweaponall", "Gives all players a weapon" },
|
|
|
|
{ 4, "/circleall", "Teleports all players around in a circle of you (used for events)" },
|
|
|
|
{ 4, "/vc", "Creating a admin vehicle (short)" },
|
|
|
|
{ 4, "/vcreate", "Creating a admin vehicle" },
|
|
|
|
{ 4, "/gotopos", "Teleport to a specifc location X Y Z" },
|
|
|
|
{ 4, "/addnote", "Attach a note to a player" },
|
|
|
|
{ 4, "/removenote", "Removing a player note" },
|
|
|
|
|
|
|
|
/* ** Level 5 Commands ** */
|
|
|
|
{ 5, "/armorall", "Giving everyone armour" },
|
|
|
|
{ 5, "/check", "Checking a players serial" },
|
|
|
|
{ 5, "/c", "Council chat" },
|
|
|
|
{ 5, "/creategarage", "Creating a garage" },
|
|
|
|
{ 5, "/destroygarage", "Deletes a garage" },
|
|
|
|
{ 5, "/connectsong", "Changes the conneciton song" },
|
|
|
|
{ 5, "/discordurl", "Updating the discord invite URL" },
|
|
|
|
{ 5, "/creategate", "Creating a gate" },
|
|
|
|
{ 5, "/editgate", "Editing a gate" },
|
|
|
|
{ 5, "/acunban", "Unbanning a player from AC" },
|
|
|
|
{ 5, "/safeisbugged", "Debug command for robbery safes" },
|
|
|
|
{ 5, "/autovehrespawn", "Setting auto respawn for vehicles" },
|
|
|
|
{ 5, "/megaban", "The Mega Ban" },
|
|
|
|
{ 5, "/achangename", "Change a players name" },
|
|
|
|
{ 5, "/unbanip", "Unbanning a IP address" },
|
|
|
|
{ 5, "/unban", "Unban a player from the server" },
|
|
|
|
{ 5, "/doublexp", "Enable/disable double XP" },
|
|
|
|
{ 5, "/toggleviewpm", "Toggle to view private messages" },
|
|
|
|
{ 5, "/respawnallv", "Respawning all server vehicles" },
|
|
|
|
{ 5, "/reconnectchuff", "Reconnecting the ChuffSec NPC" },
|
|
|
|
{ 5, "/createbribe", "Creates a bribe" },
|
|
|
|
{ 5, "/destroybribe", "Deletes a bribe " },
|
|
|
|
{ 5, "/createcar", "Create owned vehicle" },
|
|
|
|
{ 5, "/destroycar", "Deletes owned vehicle" },
|
|
|
|
{ 5, "/stripcarmods", "Removing all vehicle modifications" },
|
|
|
|
{ 5, "/createhouse", "Creating a house" },
|
|
|
|
{ 5, "/destroyhouse", "Deleting a house" },
|
|
|
|
{ 5, "/hadminsell", "Selling a house (as admin)" },
|
|
|
|
{ 5, "/forceac", "Forcing a player to use SAMP-CAC" },
|
|
|
|
{ 5, "/createbusiness", "Creates a business" },
|
|
|
|
{ 5, "/destroybusiness", "Deletes a business" },
|
|
|
|
{ 5, "/seteventhost", "Setting event host to player" },
|
|
|
|
{ 5, "/weather", "Settings world weather" },
|
2018-10-13 13:11:21 +00:00
|
|
|
{ 5, "/viewpolicechat", "Viewing the police radio/chat" },
|
2018-09-25 21:06:23 +00:00
|
|
|
|
|
|
|
/* ** Level 6 Commands ** */
|
|
|
|
{ 6, "/reloadeditor", "Reloads object editer script" },
|
|
|
|
{ 6, "/createentrance", "Creates a entrance" },
|
|
|
|
{ 6, "/destroyentrance", "Deleting a entrance" },
|
|
|
|
{ 6, "/setgangleader", "Settings a player into a gang leader" },
|
|
|
|
{ 6, "/viewgangtalk", "Viewing gang chat" },
|
|
|
|
{ 6, "/broadcast", "Broadcasting a music stream" },
|
|
|
|
{ 6, "/setlevel", "Setting a players admin level " },
|
|
|
|
{ 6, "/setleveloffline", "Setting a players admin level offline" },
|
|
|
|
{ 6, "/svrstats", "Show server statistics" },
|
|
|
|
{ 6, "/playaction", "Playing a action" },
|
|
|
|
{ 6, "/playanimation", "Playing an animation" },
|
|
|
|
{ 6, "/updaterules", "Updating the server rules" },
|
|
|
|
{ 6, "/truncate", "Truncating a account" }
|
2018-12-01 23:17:05 +00:00
|
|
|
},
|
|
|
|
g_banCodes [ ] [ E_BAN_CODE ] =
|
|
|
|
{
|
|
|
|
{ "AH", "Armor Hacking" },
|
|
|
|
{ "HH", "Health Hacking" },
|
|
|
|
{ "VHH", "Vehicle Health Hacks" },
|
|
|
|
{ "NR", "No Reload" },
|
|
|
|
{ "IA", "Infinite Ammo" },
|
|
|
|
{ "FH", "Fly Hacks" },
|
|
|
|
{ "BE", "Ban Evasion" },
|
|
|
|
{ "AB", "Air Brake" },
|
|
|
|
{ "TP", "Teleport Hacks" },
|
|
|
|
{ "WH", "Weapon Hack" },
|
|
|
|
{ "SH", "Speed Hacks" },
|
|
|
|
{ "UA", "Unlimited Ammo" },
|
|
|
|
{ "RF", "Rapid Fire" },
|
|
|
|
{ "AIM", "Aimbot" },
|
|
|
|
{ "ADV", "Advertising" }
|
|
|
|
}
|
2018-09-25 21:06:23 +00:00
|
|
|
;
|
|
|
|
|
2018-09-09 20:55:38 +00:00
|
|
|
/* ** Commands ** */
|
|
|
|
CMD:acommands( playerid, params[ ] ) return cmd_acmds( playerid, params );
|
|
|
|
CMD:acmds( playerid, params[ ] )
|
2018-09-25 21:06:23 +00:00
|
|
|
{
|
|
|
|
if ( p_AdminLevel[ playerid ] < 1 )
|
|
|
|
return SendError( playerid, ADMIN_COMMAND_REJECT );
|
|
|
|
|
|
|
|
szNormalString[ 0 ] = '\0';
|
|
|
|
|
|
|
|
for (new iPos = 1; iPos != 7; iPos ++)
|
|
|
|
{
|
|
|
|
format( szNormalString, sizeof( szNormalString ), "%sAdmin Level %d Commands\n", szNormalString, iPos );
|
|
|
|
}
|
|
|
|
|
|
|
|
ShowPlayerDialog( playerid, DIALOG_ADMIN_CMDS, DIALOG_STYLE_LIST, ""COL_PINK"Admin Commands", szNormalString, "Select", "Cancel" );
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-12-01 23:17:05 +00:00
|
|
|
/* ** Functions ** */
|
|
|
|
stock adhereBanCodes( string[ ], maxlength = sizeof( string ) )
|
|
|
|
{
|
|
|
|
for( new i; i < sizeof( g_banCodes ); i++ )
|
|
|
|
{
|
|
|
|
if ( strfind( string, g_banCodes[ i ] [ E_CODE ], false ) != -1 )
|
|
|
|
{
|
|
|
|
strreplace( string, g_banCodes[ i ] [ E_CODE ], g_banCodes[ i ] [ E_DATA ], false, 0, -1, maxlength );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-09-25 21:06:23 +00:00
|
|
|
|
2018-12-01 23:17:05 +00:00
|
|
|
/* ** Hooks ** */
|
2018-09-25 21:06:23 +00:00
|
|
|
hook OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
|
|
|
|
{
|
|
|
|
if ( dialogid == DIALOG_ADMIN_CMDS && response )
|
|
|
|
{
|
|
|
|
szHugeString[ 0 ] = '\0';
|
|
|
|
|
2018-09-26 07:01:34 +00:00
|
|
|
new
|
2018-09-25 21:06:23 +00:00
|
|
|
level = ( listitem + 1 );
|
|
|
|
|
|
|
|
if ( p_AdminLevel[ playerid ] < level )
|
|
|
|
return SendError( playerid, "You don't have permission to view these admin commands." ), cmd_acmds( playerid, "" );
|
|
|
|
|
2018-12-01 23:17:05 +00:00
|
|
|
for ( new iLine = 0; iLine < sizeof( g_commandData ); iLine ++ ) if ( g_commandData[ iLine ][ E_LEVEL ] == level )
|
2018-09-25 21:06:23 +00:00
|
|
|
{
|
2018-09-26 07:01:34 +00:00
|
|
|
format( szHugeString, sizeof( szHugeString ), "%s"COL_GREY"%s\t"COL_WHITE"%s\n",
|
2018-09-25 21:06:23 +00:00
|
|
|
szHugeString,
|
2018-12-01 23:17:05 +00:00
|
|
|
g_commandData[ iLine ][ E_COMMAND ],
|
|
|
|
g_commandData[ iLine ][ E_DESCRIPTION ]);
|
2018-09-25 21:06:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ShowPlayerDialog( playerid, DIALOG_ADMIN_CMDS_BACK, DIALOG_STYLE_TABLIST, sprintf( ""COL_PINK"Admin Level %d Commands", level ), szHugeString, "Back", "" );
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if ( dialogid == DIALOG_ADMIN_CMDS_BACK && response )
|
|
|
|
{
|
|
|
|
return cmd_acmds( playerid, "" ), 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*CMD:acmds( playerid, params[ ] )
|
2018-09-09 20:55:38 +00:00
|
|
|
{
|
|
|
|
if ( p_AdminLevel[ playerid ] < 1 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
|
|
|
|
SendClientMessage( playerid, COLOR_GREY, "|______________________________________| Admin Commands |_____________________________________|" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " " );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /goto, /spec(off), /(un)jail, /asay, /slap, /a, /getstats, /stpfr, /setskin, /frules, /fpc, /ticketlog" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /pinfo, /warn, /aspawn, /ans, /stpfa, /alog, /(un)freeze, /aod, /respawnalluv, /reports, /questions" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 1: /respond, /mutelist, /aka, /arepair, /viewdeathmsg" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 2: /kick, /vdestroy, /(un)mute, /explode, /vrespawn, /arenas, /suspend, /viewnotes, /slay" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /ban, /bring, /clearchat, /(ann)ounce, /giveweapon, /vadminpark, /vcreate, /healall, /getip, /smlog, /iclog" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /vadminstats, /pingimmune, /vbring, /countdown, /forcecoptutorial, /vgoto, /copwarn, /armywarn, /resetwep" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 3: /venter, /geolocate" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /circleall, /giveweaponall, /resetwepall, /motd, /uncopban, /unarmyban, /setworld, /destroyallav, /gotopos" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 4: /addnote, /removenote" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createhouse, /destroyhouse, /respawnallv, /achangename, /toggleviewpm, /unban(ip)" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /createcar, /destroycar, /stripcarmods, /createbribe, /destroybribe, /doublexp, /(h/v)adminsell" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /autovehrespawn, /megaban, /acunban, /creategate, /editgate, /connectsong, /discordurl" );
|
2018-09-11 07:30:24 +00:00
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 5: /creategarage, /destroygarage, /check, /reconnectchuff" );
|
2018-09-09 20:55:38 +00:00
|
|
|
|
|
|
|
if ( p_AdminLevel[ playerid ] > 5 ) {
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /setirc, /seteventhost, /setlevel, /setleveloffline, /svrstats, /playaction, /playanimation" );
|
|
|
|
SendClientMessage( playerid, COLOR_WHITE, " LEVEL 6: /updaterules, /truncate, /broadcast, /setgangleader, /viewgangtalk, /createentrance, /destroyentrance" );
|
|
|
|
}
|
|
|
|
|
|
|
|
SendClientMessage( playerid, COLOR_GREY, "|_____________________________________________________________________________________________|" );
|
|
|
|
return 1;
|
2018-09-25 21:06:23 +00:00
|
|
|
}*/
|
2018-09-09 20:55:38 +00:00
|
|
|
|
|
|
|
/* ** Modules ** */
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_one.pwn"
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_two.pwn"
|
2018-12-22 13:56:55 +00:00
|
|
|
#include "irresistible\cnr\commands\admin\admin_three.pwn"
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_four.pwn"
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_five.pwn"
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_six.pwn"
|
|
|
|
#include "irresistible\cnr\commands\admin\admin_rcon.pwn"
|