Raised This Month: $ Target: $400
 0% 

CurWeapon jitter


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 07-17-2007 , 19:32   Re: CurWeapon jitter
Reply With Quote #9

A much better method would be to alter the pev_weapons variable. Use the following stock to "remove" the weapons from the variable:

Code:
stock remove_weapon( id, wpnid ) {     new m_bitmask = pev( id, pev_weapons );     m_bitmask &= ~(1<<wpnid);         set_pev( id, pev_weapons, m_bitmask ); }

For what you want to do, however, since all you want is a knife for any class, I would alter the pev_weapons bitmask to only include DODW_AMERKNIFE (if british or american) or DODW_GERKNIFE / DODW_SPADE (if axis) and simply set the variable to that bitmask.

This way you won't have to worry about sending client commands and switching weapons and risking a "reach-around" - it prevents the client from pulling out the weapon in the first place.

For a very basic example:

Code:
stock allow_weapon( id, wpnid ) {     new m_bitmask &= (1<<wpnid);         set_pev( id, pev_weapons, m_bitmask ); }

Then allow_weapon( id, DODW_AMERKNIFE ) if the player is allies, etc.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician

Last edited by Wilson [29th ID]; 07-17-2007 at 19:34.
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
 



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 21:30.


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