Raised This Month: $51 Target: $400
 12% 

Help / Support [HELP] Block pickup specific extra item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 07-31-2016 , 19:27   [HELP] Block pickup specific extra item
Reply With Quote #1

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?

Last edited by Laoming; 07-31-2016 at 19:37.
Laoming is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode