From 4862a8abc4a2986ca04944c06426c290a0095638 Mon Sep 17 00:00:00 2001 From: Cloudy <36423427+meCloudy@users.noreply.github.com> Date: Mon, 10 Jun 2019 17:07:07 +0300 Subject: [PATCH] Allow /replenishsafe for level 5 Sets the minimum level required for /replenishsafe to 5. --- .../irresistible/cnr/commands/admin/_admin.pwn | 1 + .../cnr/commands/admin/admin_five.pwn | 17 +++++++++++++++++ .../cnr/commands/admin/admin_rcon.pwn | 17 ----------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn index a4eede9..1497ff1 100644 --- a/gamemodes/irresistible/cnr/commands/admin/_admin.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/_admin.pwn @@ -140,6 +140,7 @@ static stock { 5, "/editgate", "Editing a gate" }, { 5, "/acunban", "Unbanning a player from AC" }, { 5, "/safeisbugged", "Debug command for robbery safes" }, + { 5, "/replenishsafe", "Fixes bugged robbery safes" }, { 5, "/autovehrespawn", "Setting auto respawn for vehicles" }, { 5, "/megaban", "The Mega Ban" }, { 5, "/achangename", "Change a players name" }, diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index a423ef9..76678dd 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -276,6 +276,23 @@ CMD:safeisbugged( playerid, params[ ] ) return 1; } +CMD:replenishsafe( playerid, params[ ] ) +{ + new + rID; + + if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "d", rID ) ) return SendUsage( playerid, "/replenishsafe [SAFE_ID]" ); + else if (!Iter_Contains(RobberyCount, rID)) return SendError( playerid, "This is an invalid Safe ID." ); + else + { + printf( "[GM:ADMIN] %s has replenished %d! (Success: %d)", ReturnPlayerName( playerid ), rID, setSafeReplenished( rID ) ); + + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You've replenished Safe ID %d: "COL_GREY"%s"COL_WHITE".", rID, g_robberyData[ rID ] [ E_NAME ] ); + } + return 1; +} + CMD:autovehrespawn( playerid, params[ ] ) { #if defined _vsync_included diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn index 0f88aa4..f3aff1b 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_rcon.pwn @@ -255,23 +255,6 @@ CMD:addcomponent( playerid, params[ ] ) return 1; } -CMD:replenishsafe( playerid, params[ ] ) -{ - new - rID; - - if ( !IsPlayerAdmin( playerid ) ) return 0; - else if ( sscanf( params, "d", rID ) ) return SendUsage( playerid, "/replenishsafe [SAFE_ID]" ); - else if (!Iter_Contains(RobberyCount, rID)) return SendError( playerid, "This is an invalid Safe ID." ); - else - { - printf( "[GM:ADMIN] %s has replenished %d! (Success: %d)", ReturnPlayerName( playerid ), rID, setSafeReplenished( rID ) ); - - SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You've replenished Safe ID %d: "COL_GREY"%s"COL_WHITE".", rID, g_robberyData[ rID ] [ E_NAME ] ); - } - return 1; -} - CMD:driveby( playerid, params[ ] ) { if ( !IsPlayerAdmin( playerid ) ) return 0;