Raised This Month: $ Target: $400
 0% 

A bug in my plugin (Snipers)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-04-2009 , 06:42   A bug in my plugin (Snipers)
Reply With Quote #1

PHP Code:
#include <amxmodx> 
#include <fun> 

#define PLUGIN        " Snipers " 
#define VERSION        "1.0" 
#define AUTHOR        "TitANious (xPaw)" 


public plugin_init( )

    
register_pluginPLUGINVERSIONAUTHOR ); 
     
    
register_clcmd"say /scout",    "cmdGiveSniper" ); 
    
register_clcmd"say /sg550",    "cmdGiveSniper" ); 
    
register_clcmd"say /g3sg1",    "cmdGiveSniper" ); 
    
register_clcmd"say /awp",    "cmdGiveSniper" ); 
    
register_clcmd"say_team /scout",    "cmdGiveSniper" ); 
    
register_clcmd"say_team /sg550",    "cmdGiveSniper" ); 
    
register_clcmd"say_team /g3sg1",    "cmdGiveSniper" ); 
    
register_clcmd"say_team /awp",    "cmdGiveSniper" ); 
    


public 
cmdGiveSniperid )
{
    new 
weapon get_user_weapon(id__); 
    new 
Arg[32], szWeapon[32], szAmmoName[32]
    
read_argv(1Argcharsmax(Arg))
    switch( 
Arg[2] ) // Arg2 is /name, Arg[0] is '/', Arg[1] is first letter but 2 weapons share so check Arg[2]
    
{
        case 
'3':
        {
            if(
weapon == CSW_G3SG1)
            {
                
szAmmoName "ammo_762nato"
            
}
            else
            {
                
client_cmd(id"slot 1; drop")
                
szWeapon "weapon_g3sg1"
                
szAmmoName "ammo_762nato"
            
}
            
give_item(idszWeapon)
            }
            case 
'c':
            {
                if(
weapon == CSW_SCOUT)
                {
                    
szAmmoName "ammo_762nato"
                
}
                else
                {
                    
client_cmd(id"slot 1; drop")
                    
szWeapon "weapon_scout"
                    
szAmmoName "ammo_762nato"
                
}
                
give_item(idszWeapon)
            }
                case 
'g':
                {
                    if(
weapon == CSW_SG550)
                    {
                        
szAmmoName "ammo_556nato"
                    
}
                    else
                    {
                        
client_cmd(id"slot 1; drop")
                        
szWeapon "weapon_sg550"
                        
szAmmoName "ammo_556nato"
                    
}
                    
give_item(idszWeapon)
                }
                    case 
'w':
                    {
                        if(
weapon == CSW_AWP)
                        {
                            
szAmmoName "ammo_338magnum"
                        
}
                        else
                        {
                            
client_cmd(id"slot 1; drop")
                            
szWeapon "weapon_awp"
                            
szAmmoName "ammo_338magnum"
                        
}
                        
give_item(idszWeapon)
                        
// 3 is the max for each ammo type, don't try to give 10.
                        
for(new ii<3i++)
                        {
                        
give_item(idszAmmoName)
                        }
                    }
                }
            } 
My bug:
Code:
Exampel:
Starting game.
I haven't bought anything
I press /scout
It dont equips, but drops
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
 


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


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