Raised This Month: $ Target: $400
 0% 

Check and give weapons inaccuracy...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-17-2013 , 02:50   Re: Check and give weapons inaccuracy...
Reply With Quote #4

I think pev->weapons (check by user_has_weapon) is updated right after, so check bpammo in combination.
Also, when you are checking more than 1 weapon, prefer pev_weapons rather than user_has_weapon, but it's not a big deal if you prefer to stick with user_has_weapon, would be different if code would be called often as in PreThink for example.

PHP Code:
    new weapons pev(idpev_weapons)
    
HasC4[id] = ( weapons 1<<CSW_C4 )
    
HasHE[id] = ( weapons 1<<CSW_HEGRENADE ) && cs_get_user_bpammo(idCCSW_HEGRENADE)
    
HasSG[id] = ( weapons 1<<CSW_SMOKEGRENADE ) && cs_get_user_bpammo(idCCSW_SMOKEGRENADE
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-17-2013 at 02:51.
ConnorMcLeod 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 10:56.


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