From 8acd25ea240f6d338178be64cb03176e6f1947c9 Mon Sep 17 00:00:00 2001 From: Dusan Date: Sun, 9 Jun 2019 22:42:02 +0200 Subject: [PATCH] Update admin_five.pwn --- .../cnr/commands/admin/admin_five.pwn | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn index 6b82083..3adfe87 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_five.pwn @@ -1001,3 +1001,43 @@ thread OnPlayerUnforceAC( playerid, player[ ], pID, bool:offline ) } return 1; } + +CMD:giveboombox( playerid, params[ ] ) +{ + new + pID; + + if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/giveboombox [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( p_Boombox{ pID } == true ) return SendError( playerid, "Player already has boombox in his inventory." ); + else + { + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) gave you boombox.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have given boombox to %s(%d).", ReturnPlayerName( pID ), pID ); + AddAdminLogLineFormatted( "%s(%d) has given boombox to %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + p_Boombox{ pID } = true; + } + return 1; +} + +CMD:removeboombox( playerid, params[ ] ) +{ + new + pID; + + if ( p_AdminLevel[ playerid ] < 5 ) return SendError( playerid, ADMIN_COMMAND_REJECT ); + else if ( sscanf( params, "u", pID ) ) return SendUsage( playerid, "/removeboombox [PLAYER_ID]" ); + else if ( !IsPlayerConnected( pID ) || IsPlayerNPC( pID ) ) return SendError( playerid, "Invalid Player ID." ); + else if ( p_Boombox{ pID } == false ) return SendError( playerid, "Player doesn't have boombox in his inventory." ); + else + { + SendClientMessageFormatted( pID, -1, ""COL_PINK"[ADMIN]"COL_WHITE" %s(%d) has removed your boombox.", ReturnPlayerName( playerid ), playerid ); + SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" You have removed boombox from %s(%d).", ReturnPlayerName( pID ), pID ); + AddAdminLogLineFormatted( "%s(%d) has removed boombox from %s(%d)", ReturnPlayerName( playerid ), playerid, ReturnPlayerName( pID ), pID ); + p_UsingBoombox{ pID } = false; + p_Boombox{ pID } = false; + Boombox_Destroy( pID ); + } + return 1; +} \ No newline at end of file