Raised This Month: $ Target: $400
 0% 

Strings in enums?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
sake
Senior Member
Join Date: Jul 2011
Old 07-19-2011 , 10:44   Re: Strings in enums?
Reply With Quote #3

PHP Code:
switch(primary[id])
    {
        case 
M4A1:
        {
            
give_item(id,"weapon_m4a1");
            
ExecuteHam(Ham_GiveAmmoid200"556nato"200);
            
        }    
        case 
AK47:
        {
            
give_item(id,"weapon_ak47");
            
ExecuteHam(Ham_GiveAmmoid200"762nato"200);
        }
        case 
SG552:
        {
            
give_item(id,"weapon_sg552");
            
ExecuteHam(Ham_GiveAmmoid200"556nato"200);
        }
        case 
AUG:
        {
            
give_item(id,"weapon_aug");
            
ExecuteHam(Ham_GiveAmmoid200"556nato"200);
        }
        case 
M3:
        {
            
give_item(id,"weapon_m3");
            
ExecuteHam(Ham_GiveAmmoid200"buckshot"200);
        }
        case 
MP5:
        {
            
give_item(id,"weapon_mp5navy");
            
ExecuteHam(Ham_GiveAmmoid200"9mm"200);
        }
        case 
PARA:
        {
            
give_item(id,"weapon_m249");
            
ExecuteHam(Ham_GiveAmmoid200"556natobox"200);
        }
        case 
AWP:
        {
            
give_item(id,"weapon_awp");
            
ExecuteHam(Ham_GiveAmmoid200"338magnum"200);
        }
    } 
I want to make this less code by using

PHP Code:
give_item(id,INSERTWEAPONCONSTANTHERE);
ExecuteHam(Ham_GiveAmmoid200"338magnum"200); 
sake 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 01:08.


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