Raised This Month: $ Target: $400
 0% 

Unlimited-Clips


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-13-2009 , 17:12   Re: Unlimited-Clips
Reply With Quote #2

Here you go

I added 1 to the max clip ammo just so the clip ammo will always appear full instead of -1. ie. Using glock should always say 12 but without +1 it will always say 11. I'm not sure if the +1 will cause errors or not, it didn't while I tested. If you don't care about the clip ammo always being -1 of max then just remove the +1.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Unlimited Clip Ammo"
#define VERSION "1.0"
#define AUTHOR "bugsy"

#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif

const OFFSET_LINUX_WEAPONS 4

new const g_MaxClipAmmo[] = 
{
    
0,
    
13//CSW_P228
    
0,
    
10//CSW_SCOUT
    
0,  //CSW_HEGRENADE
    
7,  //CSW_XM1014
    
0,  //CSW_C4
    
30,//CSW_MAC10
    
30//CSW_AUG
    
0,  //CSW_SMOKEGRENADE
    
15,//CSW_ELITE
    
20,//CSW_FIVESEVEN
    
25,//CSW_UMP45
    
30//CSW_SG550
    
35//CSW_GALIL
    
25//CSW_FAMAS
    
12,//CSW_USP
    
20,//CSW_GLOCK18
    
10//CSW_AWP
    
30,//CSW_MP5NAVY
    
100,//CSW_M249
    
8,  //CSW_M3
    
30//CSW_M4A1
    
30,//CSW_TMP
    
20//CSW_G3SG1
    
0,  //CSW_FLASHBANG
    
7,  //CSW_DEAGLE
    
30//CSW_SG552
    
30//CSW_AK47
    
0,  //CSW_KNIFE
    
50//CSW_P90
}

public 
plugin_init() 
{
    
register_pluginPLUGIN VERSION AUTHOR );
    
register_event"CurWeapon" "fw_CurWeapon" "b" "1=1" );
}

public 
fw_CurWeaponid )
{
    static 
szWeapon[32], iWeaponiWeaponEntity;
    
    
iWeapon read_data);
    
    
get_weaponnameiWeapon szWeapon sizeof szWeapon );
    
iWeaponEntity fm_find_ent_by_owner( -szWeapon id );
    
    
fm_set_weapon_ammoiWeaponEntity g_MaxClipAmmoiWeapon ] + );
}

public 
fm_find_ent_by_ownerentity , const classname[] , owner )
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

public 
fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);

__________________

Last edited by Bugsy; 06-13-2009 at 17:15.
Bugsy 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 13:52.


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