Raised This Month: $ Target: $400
 0% 

Bitsums and weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-24-2013 , 07:19   Bitsums and weapons
Reply With Quote #1

Why this code doesn't get all weapons?
PHP Code:
#include <amxmodx>

new Cvar_Weapons

public plugin_init()
{
    
Cvar_Weapons register_cvar("ttt_weapons""abcdefghijklmnopqrstuvwxyz")
    
    
register_clcmd("say wpn""weap")
}

public 
weap(id)
{
    new 
weapons[30], weapidweapname[20]
    
get_pcvar_string(Cvar_Weaponsweapons29)
    new 
flags read_flags(weapons)
    
    
//client_print(id, 3, "%s", weapons)
    //client_print(id, 3, "flags: %d", flags)
        
    
for(weapid CSW_P228;weapid <= CSW_P90;weapid++)
    {
        if(
flags & (1<<weapid))
        {
            if(
get_weaponname(weapidweapname19))
                
client_print(id3"%d - %s"weapidweapname)
        }
    }

Prints:
Code:
1 - weapon_p228
3 - weapon_scout
4 - weapon_hegrenade
5 - weapon_xm1014
6 - weapon_c4
7 - weapon_mac10
8 - weapon_aug
9 - weapon_smokegrenade
10 - weapon_elite
11 - weapon_fiveseven
12 - weapon_ump45
13 - weapon_sg550
14 - weapon_galil
15 - weapon_famas
16 - weapon_usp
17 - weapon_glock18
18 - weapon_awp
19 - weapon_mp5navy
20 - weapon_m249
21 - weapon_m3
22 - weapon_m4a1
23 - weapon_tmp
24 - weapon_g3sg1
25 - weapon_flashbang
__________________
alan_el_more is offline
 


Thread Tools
Display Modes

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 23:14.


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