View Single Post
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 01-21-2019 , 22:14   Re: Removing particular weapon pick up
Reply With Quote #2

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(weaponid
{
    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_aliveid ) || ( cs_get_user_teamid ) != CS_TEAM_T ) )
    {
        return 
HAM_IGNORED
    
}
   
    static 
classname[32]
    
pev(weaponpev_classnameclassnamecharsmax(classname))
 
    for(new 
0sizeof tResti++)
    if (!
equal(classnametRest[i])) 
    {
        
//Sends a message that weapons are only for CT's
        
client_print(idprint_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!
__________________

Last edited by deprale; 01-21-2019 at 22:26. Reason: forgot to include the capital R in the "tRest" var in the for loop
deprale is offline