Raised This Month: $ Target: $400
 0% 

Help with cs_get_weapon_id


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-04-2010 , 15:13   Help with cs_get_weapon_id
Reply With Quote #1

I want to know the weapon a guy is holding, and set a string to a value which is what the gun max can hold in one mag. I did it this way:

PHP Code:
new ca
            
            
//find what weapon type the player has
            
switch(cs_get_weapon_id(player))
            {
            case 
CSW_P228 ca 13;
            case 
CSW_SCOUT ca 10;
            case 
CSW_HEGRENADE ca 0;
            case 
CSW_XM1014 ca 7;
            case 
CSW_C4 ca 0;
            case 
CSW_MAC10 ca 30;
            case 
CSW_AUG ca 30;
            case 
CSW_SMOKEGRENADE ca 0;
            case 
CSW_ELITE ca 15;
            case 
CSW_FIVESEVEN ca 20;
            case 
CSW_UMP45 ca 25;
            case 
CSW_SG550 ca 30;
            case 
CSW_GALI ca 35;
            case 
CSW_FAMAS ca 25;
            case 
CSW_USP ca 12;
            case 
CSW_GLOCK18 ca 20;
            case 
CSW_AWP ca 10;
            case 
CSW_MP5NAVY ca 30;
            case 
CSW_M249 ca 100;
            case 
CSW_M3 ca 8;
            case 
CSW_M4A1 ca 30;
            case 
CSW_TMP ca 30;
            case 
CSW_G3SG1 ca 20;
            case 
CSW_FLASHBANG ca 0;
            case 
CSW_DEAGLEca 7;
            case 
CSW_SG552 ca 30;
            case 
CSW_AK47 ca 30;
            case 
CSW_P90 ca 50;
            
            } 
Then I was looking at the includes on how to actually use the native, as of what I heard, it would just give out the CSW_* type, but I can see now, that it is not, but it gives a number. Now here comes my question. First the amxconst.inc:

Code:
/* Id of weapons in CS */
#define CSW_P228        1
#define CSW_SCOUT        3
#define CSW_HEGRENADE        4
#define CSW_XM1014        5
#define CSW_C4            6
#define CSW_MAC10        7
#define CSW_AUG            8
#define CSW_SMOKEGRENADE    9
#define CSW_ELITE        10
#define CSW_FIVESEVEN        11
#define CSW_UMP45        12
#define CSW_SG550        13
#define CSW_GALI        14
#define CSW_GALIL        14
#define CSW_FAMAS        15
#define CSW_USP            16
#define CSW_GLOCK18        17
#define CSW_AWP            18
#define CSW_MP5NAVY        19
#define CSW_M249        20
#define CSW_M3            21
#define CSW_M4A1        22
#define CSW_TMP            23
#define CSW_G3SG1        24
#define CSW_FLASHBANG        25
#define CSW_DEAGLE        26
#define CSW_SG552        27
#define CSW_AK47        28
#define CSW_KNIFE        29
#define CSW_P90            30
#define CSW_VEST        31
#define CSW_VESTHELM    32
I am just curious here. Is there no #2 weapon, or is it just my include which is outdated?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
 



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 07:07.


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