View Single Post
JohnRambo
Junior Member
Join Date: Jan 2014
Old 01-11-2014 , 04:56   Re: [REQ] Full bpammo ONLY when buying new weapon!
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
/*    Formatright © 2010, ConnorMcLeod

    Full BpAmmo On Spawn is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Full BpAmmo On Spawn; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

#define ammo_338magnum 1
#define ammo_9mm 10

#define XTRA_OFS_PLAYER    5
#define m_rgAmmo_Slot0    376

new const g_iMaxBpAmmo[] = {
    
0,
    
30,
    
90,
    
200,
    
90,
    
32,
    
100,
    
100,
    
35,
    
52,
    
120
}

public 
plugin_init()
{
    
register_plugin("Full BpAmmo On Spawn"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
}

public 
Ham_CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        for(new 
iAmmoIndex=ammo_338magnumiAmmoIndex<=ammo_9mmiAmmoIndex++)
        {
            
set_pdata_int(idm_rgAmmo_Slot0 iAmmoIndexg_iMaxBpAmmo[iAmmoIndex], XTRA_OFS_PLAYER)
        }
    }

Here is ConnorMcLeod's great plugin for exapmle, but it gives full bpammo every round.
JohnRambo is offline