Raised This Month: $ Target: $400
 0% 

Ham_Touch / Limitation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MiniBrackeur
Senior Member
Join Date: Oct 2010
Old 05-01-2012 , 14:01   Ham_Touch / Limitation
Reply With Quote #1

Hello everybody !
I have got a problem, my code works good exept two bugs, the famas and scout aren't limited (I do not know why! O_o).

So, I seek to delete this problem and shorten the code if possible...

PHP Code:
public client_weapon_pickup(id)
{
    new 
Weapons[32]
    new 
WeaponNum
    
new Weapon
    
    get_user_weapons
(idWeaponsWeaponNum)
    
    for (new 
<= WeaponNumi++)
    {
        
Weapon Weapons[i]
        
        new 
niveau_limitation pl_limitation[id]
        if(
niveau_limitation >= 1)
        {
            if(
niveau_limitation >= 2)
            {
                if(
niveau_limitation >= 3)
                {
                    if(
niveau_limitation >= 4)
                    {
                        if(
niveau_limitation >= 5)
                        {
                            if(
niveau_limitation >= 6)
                            {
                                if(
niveau_limitation >= 7)
                                {
                                    if((
Weapon == CSW_USP) || (Weapon == CSW_GLOCK18))   
                                    {
                                        switch(
Weapon)
                                        {
                                            case 
CSW_USP:
                                            {
                                                
console_cmd(id"drop weapon_usp")
                                            }
                                            case 
CSW_GLOCK18:
                                            {
                                                
console_cmd(id"drop weapon_glock18")
                                            }
                                        }
                                        
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                                    }
                                }
                                if((
Weapon == CSW_P228) || (Weapon == CSW_DEAGLE) || (Weapon == CSW_FIVESEVEN) || (Weapon == CSW_ELITE))   
                                {
                                    switch(
Weapon)
                                    {
                                        case 
CSW_P228:
                                        {
                                            
console_cmd(id"drop weapon_p228")
                                        }
                                        case 
CSW_DEAGLE:
                                        {
                                            
console_cmd(id"drop weapon_deagle")
                                        }
                                        case 
CSW_FIVESEVEN:
                                        {
                                            
console_cmd(id"drop weapon_fiveseven")
                                        }
                                        case 
CSW_ELITE:
                                        {
                                            
console_cmd(id"drop weapon_elite")
                                        }
                                    }
                                    
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                                }
                            }
                            if((
Weapon == CSW_M3) || (Weapon == CSW_XM1014))   
                            {
                                switch(
Weapon)
                                {
                                    case 
CSW_M3:
                                    {
                                        
console_cmd(id"drop weapon_m3")
                                    }
                                    case 
CSW_XM1014:
                                    {
                                        
console_cmd(id"drop weapon_xm1014")
                                    }
                                }
                                
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                            }
                        }
                        if((
Weapon == CSW_MAC10) || (Weapon == CSW_TMP) || (Weapon == CSW_MP5NAVY) || (Weapon == CSW_UMP45) || (Weapon == CSW_P90))   
                        {
                            switch(
Weapon)
                            {
                                case 
CSW_MAC10:
                                {
                                    
console_cmd(id"drop weapon_mac10")
                                }
                                case 
CSW_TMP:
                                {
                                    
console_cmd(id"drop weapon_tmp")
                                }
                                case 
CSW_MP5NAVY:
                                {
                                    
console_cmd(id"drop weapon_mp5navy")
                                }
                                case 
CSW_UMP45:
                                {
                                    
console_cmd(id"drop weapon_ump45")
                                }
                                case 
CSW_P90:
                                {
                                    
console_cmd(id"drop weapon_p90")
                                }
                            }
                            
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                        }
                    }
                    if((
Weapon == CSW_GALIL) || (Weapon == CSW_FAMAS) || (Weapon == CSW_M4A1) || (Weapon == CSW_AK47) || (Weapon == CSW_AUG) || (Weapon == CSW_SG552))   
                    {
                        switch(
Weapon)
                        {
                            case 
CSW_GALIL:
                            {
                                
console_cmd(id"drop weapon_galil")
                            }
                            case 
CSW_FAMAS:
                            {
                                
console_cmd(id"drop weapon_famas")
                            }
                            case 
CSW_M4A1:
                            {
                                
console_cmd(id"drop weapon_m4a1")
                            }
                            case 
CSW_AK47:
                            {
                                
console_cmd(id"drop weapon_ak47")
                            }
                            case 
CSW_AUG:
                            {
                                
console_cmd(id"drop weapon_aug")
                            }
                            case 
CSW_SG552:
                            {
                                
console_cmd(id"drop weapon_sg552")
                            }
                        }
                        
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                    }
                }
                if((
Weapon == CSW_SCOUT) || (Weapon == CSW_AWP) || (Weapon == CSW_SG550) || (Weapon == CSW_G3SG1))   
                {
                    switch(
Weapon)
                    {
                        case 
CSW_SCOUT:
                        {
                            
console_cmd(id"drop weapon_scout")
                        }
                        case 
CSW_AWP:
                        {
                            
console_cmd(id"drop weapon_awp")
                        }
                        case 
CSW_SG550:
                        {
                            
console_cmd(id"drop weapon_sg550")
                        }
                        case 
CSW_G3SG1:
                        {
                            
console_cmd(id"drop weapon_g3sg1")
                        }
                    }
                    
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
                }
            }
            if(
Weapon == CSW_M249)   
            {
                
console_cmd(id"drop weapon_m249")
                
client_print(idprint_center"%L"LANG_PLAYER"LIMITATION_DROP")
            }
        }
    }

Sorry for my bad english, I'm french ^^'

Thank's for your attention
__________________
MiniBrackeur => Daminou

Last edited by MiniBrackeur; 06-09-2012 at 07:46.
MiniBrackeur 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 07:53.


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