Code:
/* Plugin generated by AMXX-Studio */
/*
If there is only one C4 bomb in the game, you do not need the line "#define MORE_THAN_ONE_BOMB".
Command : amx_ctpickupc4 ; Effect cvar changing immediately,not till new round.
Cvar : amx_allowctpickupbomb ; Set it to 1, let CTs pick up C4; else CT can't pick up C4.
: amx_allowctplantbomb ; Set it to 0,CTs can not plant the C4 time bomb.
If you change this cvar to 1 only, it dose not effect until new round begins.
beacause the real state value stored at g_last...
Changing log:
v1.6 remove entity safest with VEN@amxx's help and change hudmessage
v1.5 remove the real C4 entity from the world with VEN@amxx's help.
v1.4 ....change a few
v1.3 Just written in normal and released
*/
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#define PLUGIN "CT PickUP C4"
#define VERSION "1.6"
#define AUTHOR "KinSprite"
#define MORE_THAN_ONE_BOMB
new g_allowctpickupbomb
new g_lastcvarvalue
new g_allowctplantbomb
new g_lastallowctplantbomb
new bool:allowctpickupbomb[33]=true
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("ctpickupc4.txt")
register_concmd("amx_ctpickupc4","cmdallowctpickupbomb",ADMIN_IMMUNITY," Effect cvar changing immediately,not until new round.")
register_logevent("startnewround",2,"0=World triggered","1=Round_Start")
register_logevent("ct_dropbomb",3,"1=triggered")
register_touch("weaponbox", "player", "ctpickupbomb")
g_allowctpickupbomb = register_cvar("amx_allowctpickupbomb","0")
g_allowctplantbomb = register_cvar("amx_allowctplantbomb","1")
}