Raised This Month: $ Target: $400
 0% 

Need "1 bullet" plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elplouk
Member
Join Date: Aug 2009
Location: France
Old 04-01-2011 , 19:15   Need "1 bullet" plugin
Reply With Quote #1

I need a plugin that makes the following thing :
Players can only shoot 1 bullet, and then, they need to reload to shoot another bullet, no matter which gun it is.

I think you don't need more explanations, the goal is very simple

BTW, it will run on a server with CSDM

Thanks a lot
elplouk is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-01-2011 , 19:48   Re: Need "1 bullet" plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define m_pActiveItem 373

const WEAPONS_PISTOLS = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
const 
WEAPONS_SHOTGUNS = (1<<CSW_XM1014)|(1<<CSW_M3);
const 
WEAPONS_SUBMACHINEGUNS = (1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_MP5NAVY)|(1<<CSW_TMP)|(1<<CSW_P90);
const 
WEAPONS_RIFLES = (1<<CSW_SCOUT)|(1<<CSW_AUG)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_M4A1)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47);
const 
WEAPONS_MACHINEGUNS = (1<<CSW_M249);

const 
VALID_WEAPONS WEAPONS_PISTOLS|WEAPONS_SHOTGUNS|WEAPONS_SUBMACHINEGUNS|WEAPONS_RIFLES|WEAPONS_MACHINEGUNS;

public 
plugin_init()
{
    
register_plugin("1 Bullet""0.0.1""Exolent");
    
    
register_event("CurWeapon""EventCurWeapon""be""1=1");
}

public 
EventCurWeapon(id)
{
    new 
weapon read_data(2);
    
    if( (
1<<weapon) & VALID_WEAPONS )
    {
        new 
entity get_pdata_cbase(idm_pActiveItem5);
        
        if( 
entity )
        {
            new 
clip cs_get_weapon_ammo(entity);
            
            if( 
clip )
            {
                
cs_set_weapon_ammo(entity1);
                
cs_set_user_bpammo(idweaponcs_get_user_bpammo(idweapon) + clip 1);
            }
        }
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
elplouk
Member
Join Date: Aug 2009
Location: France
Old 04-02-2011 , 01:43   Re: Need "1 bullet" plugin
Reply With Quote #3

Wow, that's fast...
I just tested it on my server, it works perfect

I love you
elplouk is offline
Reply



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 00:11.


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