AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Unlimited Clip Ammo (https://forums.alliedmods.net/showthread.php?t=94658)

-Acid- 06-13-2009 19:13

Unlimited Clip Ammo
 
1 Attachment(s)
Unlimited Clip Ammo


Description: This plugin will give a player unlimited ammo clip to all gun. Once you connect to the server you would already have unlimited clips, no commands needed.

Commands: So far none. Just enter the server and the plugin will do its job =)

How To Install: Install this like any other 3 party plugin.


Credits
Bugsy: For helping me code it.

This is my very first plugin so yea go easy on me!! XD.:mrgreen:

To Do
//Add a menu when player connects if they want
//unlimited clips

Only Tested on CStrike

ConnorMcLeod 06-14-2009 05:58

Re: Unlimited Clip Ammo
 
To retrieve weapon entity id, you can just do this (include hamsandwich) :


#define m_pActiveItem 373

Code:
    iWeaponEntity = get_pdata_cbase(id, m_pActiveItem)

Also, use a define instead of fm_set_weapon_ammo function should be faster :

#define fm_cs_get_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)


Register Curweapon event with flags "be" so you are sure player is alive.

Last, you should check if the weapon is not knife or nade or c4


PHP Code:

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

#define PLUGIN "Unlimited Clip Ammo"
#define VERSION "1.0"
#define AUTHOR "-Acid-"

// weapons offsets
#define OFFSET_CLIPAMMO        51
#define OFFSET_LINUX_WEAPONS    4
#define fm_cs_get_weapon_ammo(%1,%2)    set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)

// players offsets
#define m_pActiveItem 373

const NOCLIP_WPN_BS    = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

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" "Event_CurWeapon" "be" "1=1" );
}

public 
Event_CurWeaponid )
{
    new 
iWeapon read_data(2)
    if( !( 
NOCLIP_WPN_BS & (1<<iWeapon) ) )
    {
        
fm_cs_get_weapon_ammoget_pdata_cbase(idm_pActiveItem) , g_MaxClipAmmoiWeapon ] )
    }



-Acid- 06-14-2009 13:58

Re: Unlimited Clip Ammo
 
Okay its now updated thanks

-Acid- 06-16-2009 17:06

Re: Unlimited Clip Ammo
 
When is this going to be to be check by a plugin approve??

fezh 06-16-2009 17:09

Re: Unlimited Clip Ammo
 
Quote:

Originally Posted by -Acid- (Post 850403)
When is this going to be to be check by a plugin approve??

There isn't a time, since the approvers only do their work when this section have more than 7 pages, or something like that.

-Acid- 06-16-2009 17:14

Re: Unlimited Clip Ammo
 
oh i see

C.H.U.D. 06-17-2009 07:42

Re: Unlimited Clip Ammo
 
This plugin is much better
http://forums.alliedmods.net/showthread.php?t=26991

-Acid- 06-17-2009 14:44

Re: Unlimited Clip Ammo
 
Quote:

Originally Posted by C.H.U.D. (Post 850794)

Like i said in my description, Once you connect to the server you would already have unlimited clips. The link you said is better, you have to set the players unlimited ammo every time they connect.

ConnorMcLeod 06-17-2009 14:59

Re: Unlimited Clip Ammo
 
Quote:

Originally Posted by -Acid- (Post 851019)
you have to set the players unlimited ammo every time they connect.

Awesome, could you add this feature in your plugin ? :mrgreen:

C.H.U.D. 06-17-2009 15:03

Re: Unlimited Clip Ammo
 
Quote:

Originally Posted by -Acid- (Post 851019)
Like i said in my description, Once you connect to the server you would already have unlimited clips. The link you said is better, you have to set the players unlimited ammo every time they connect.


Thats cool did not get that part.. will test


All times are GMT -4. The time now is 10:59.

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