Raised This Month: $ Target: $400
 0% 

OFFSET_PRIMARYWEAPON issue


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-14-2011 , 04:33   Re: OFFSET_PRIMARYWEAPON issue
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
Seems to be just a boolean value, only for showing if player has a primary weapon or not.
ahh Thanks.. i figured out how to use a define to do the check i needed.

PHP Code:
#define PRIMARY_WEAPON ((1 << CSW_SCOUT) | (1 << CSW_XM1014) | (1 << CSW_MAC10) | (1 << CSW_AUG) | (1 << CSW_UMP45) | (1 << CSW_SG550) | (1 << CSW_GALIL) | (1 << CSW_FAMAS) | (1 << CSW_AWP) | (1 << CSW_MP5NAVY) | (1 << CSW_M249) | (1 << CSW_M3) | (1 << CSW_M4A1) | (1 << CSW_TMP) | (1 << CSW_G3SG1) | (1 << CSW_SG552) | (1 << CSW_AK47) | (1 << CSW_P90))
#define SECONDARY_WEAPON ((1 << CSW_P228) | (1 << CSW_ELITE) | (1 << CSW_FIVESEVEN) | (1 << CSW_USP) | (1 << CSW_GLOCK18) | (1 << CSW_DEAGLE))
#define NO_BPAMMO ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))



new currentPrimaryAmmo;
                    new 
currentSecondaryAmmo;
                    new 
maxPrimaryAmmo;
                    new 
maxSecondaryAmmo;
                    new 
szWeapon[32], iWeapons[32], iWeaponNum;
        
                    
get_user_weapons(targetiWeaponsiWeaponNum);
                    
                    for(new 
0iWeaponNumi++)
                    {
                        
get_weaponname(iWeapons[i], szWeaponcharsmax(szWeapon));
                        
                        if(
NO_BPAMMO & (<< iWeapons[i]))
                            continue;
                        
                        if(
PRIMARY_WEAPON & (<< iWeapons[i]))
                        {
                            
client_print(idprint_chat"Player's Primary weapon: %s"szWeapon);
                            
client_print(targetprint_chat"Your Primary weapon: %s"szWeapon);
                            
g_iTargetPrimaryWeapon[target] = iWeapons[i];
                            
currentPrimaryAmmo cs_get_user_bpammo(targetiWeapons[i]);
                            
maxPrimaryAmmo g_WeaponBPAmmo[iWeapons[i]];
                        }
                        if(
SECONDARY_WEAPON & (<< iWeapons[i]))
                        {
                            
client_print(idprint_chat"Player's Secondary weapon: %s"szWeapon);
                            
client_print(targetprint_chat"Your Secondary weapon: %s"szWeapon);
                            
g_iTargetSecondaryWeapon[target] = iWeapons[i];
                            
currentSecondaryAmmo cs_get_user_bpammo(targetiWeapons[i]);
                            
maxSecondaryAmmo g_WeaponBPAmmo[iWeapons[i]];
                        }
                    } 
Doc-Holiday 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 03:27.


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