Raised This Month: $ Target: $400
 0% 

CurWeapon jitter


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
stupok
Veteran Member
Join Date: Feb 2006
Old 07-17-2007 , 23:22   Re: CurWeapon jitter
Reply With Quote #13

If I understood Wilson correctly, removing a weapon from the player's bit mask disables the player from accessing that weapon altogether.

I think this would work, using Wilson's suggestion. (It's probably not the best or most efficient way, though.)

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <dodconst>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "stupok69"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("ResetHUD""event_resethud")
}

public 
event_resethud(id)
{
    
remove_all_weapons(id)
    
    
// I don't know how to properly check the team for DoD.
    
    
if(pev(idpev_team) == ALLIES)
    {
        
allow_weapon(idDODW_AMERKNIFE)
        
allow_weapon(idDODW_BRITKNIFE)
    }
    else
    {
        
allow_weapon(idDODW_GERKNIFE)
        
allow_weapon(idDODW_SPADE)
    }
}

stock remove_all_weapons(id)
{
    new 
m_bitmask pev(idpev_weapons)
    
    for(new 
1<= 41i++)
    {
        
m_bitmask &= ~(1<<i)
    }
    
    
set_pev(idpev_weaponsm_bitmask)
}

stock remove_weapon(idwpnid)
{
    new 
m_bitmask pev(idpev_weapons)
    
m_bitmask &= ~(1<<wpnid)
    
    
set_pev(idpev_weaponsm_bitmask)
}

stock allow_weapon(idwpnid)
{
    new 
m_bitmask &= (1<<wpnid)
    
    
set_pev(idpev_weaponsm_bitmask)

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


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