PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta_util>
new g_tRest;
new const tRest[][] =
{
"weapon_c4"
}
public plugin_init()
{
RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon");
RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon");
g_tRest = register_cvar("amx_tRest", "1");
}
public fw_TouchWeapon(weapon, id)
{
if (!get_pcvar_num(g_tRest)) //Checks if g_tRest is deactivated (set to 0)
return PLUGIN_CONTINUE //If it is, let players on T side pick up weapons
if ( !is_user_alive( id ) || ( cs_get_user_team( id ) != CS_TEAM_T ) )
{
return HAM_IGNORED
}
static classname[32]
pev(weapon, pev_classname, classname, charsmax(classname))
for(new i = 0; i < sizeof tRest; i++)
if (!equal(classname, tRest[i]))
{
//Sends a message that weapons are only for CT's
client_print(id, print_center, "You can only pick up the bomb on T side.")
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
Try it, didn't test. (DRUNK & my b-day)
If not, wait for someone more qualified to answer!
ALSO forgot to specify, thanks to Unkolix(VIP Plugin V5.4.5) and AMXX Documentation I was able to code this, Hope it works!
__________________