Raised This Month: $ Target: $400
 0% 

Make it so user can not drop given weapon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
taheri6
Member
Join Date: Mar 2006
Old 12-24-2007 , 14:17   Make it so user can not drop given weapon
Reply With Quote #1

Hello,

I was wondering if any one knew of a good way to do this.

When the client is affected by a particular status, they are given a weapon which replaces their primary weapon. While that status is lasting, I do not want them to be able to drop that weapon so they could just then re-pickup their dropped weapon again.

in the search:
Code:
[...blah...]
UsedDepower[id] = 1;
depower_replace(id);
new parm[1];
parm[0] = id;
set_task( fcooldownTime, "reset_depowered", 50+id, parm, 1);
[...blah...]
in depower_replace
Code:
[...blah...]
	get_user_weapons( id , wpnList , number );

	for ( new i = 0; i < number; i++) 
	{
		//Skip pistols, grenades, knife - only go for primary weapons
		if ( !IsWeaponPrimary( wpnList[i] ) )
		{
			continue;
		}

		//Get the weapon name
		get_weaponname( wpnList[i] , wpname , 31 );
		//and make them drop it
		engclient_cmd( id , "drop" , wpname );

	}
	give_item( id , "weapon_tmp" );
	give_item( id , "ammo_9mm" );

	return PLUGIN_CONTINUE;
}
So basically when afflicted they drop their weapon and are given a TMP instead. But right now there is nothing stopping them from picking it back up right away.

Is there a good way (perhaps a native?) that wont cause a lag ?

Thank you in advance.
taheri6 is offline
 



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 11:06.


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