Hello guys. I need help with my code to block pick up one specific ExtraItem. I try many my ideas, but no one works without bugs...
I try this:
Code:
register_event( "CurWeapon", "BlockPickUp", "be", "1=1" );
public BlockPickUp( id )
{
if( !is_user_connected( id ) )
return;
if( get_user_weapon( id ) == CSW_M3 && CannonsOwned > 0 )
{
client_cmd( id, "drop" );
client_print( id, print_center, "Tato zbran je jen pro ExtraVIP" );
return;
}
}
This works...but any special item is based to weapons ID, for example this extra item have ID -> CSW_M3. So this extra item Cant be pickuped by someone, but also M3 normal weapon. Im need block only pickup this extra item, nothing more.
And i try this:
Code:
RegisterHam( Ham_Touch, "weaponbox", "BlockPickUp" );
RegisterHam (Ham_Touch, "armoury_entity", "BlockPickUp" );
public BlockPickUp( iEntity, id )
{
if( !is_user_connected( id ) )
return HAM_IGNORED;
new Model[ 32 ];
pev( iEntity, pev_model, Model, 31 );
if( equal( Model, "models/mix-arena_zombie/w_vulcangun.mdl" ) )
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
And this works only for normal weapons models, for example w_m3.mdl , w_m4a1.mdl.
Someone help me ? How i create condition to control who takes this extraitem from ground?