Raised This Month: $95 Target: $400
 23% 

Unlimited Clip Ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Emp` (115)
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-13-2009 , 20:13   Unlimited Clip Ammo
Reply With Quote #1

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.

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

Only Tested on CStrike
Attached Files
File Type: sma Get Plugin or Get Source (Unlimited_Clip_Ammo.sma - 31547 views - 1.9 KB)
__________________

Last edited by -Acid-; 06-25-2009 at 21:13. Reason: Update
-Acid- is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2009 , 06:58   Re: Unlimited Clip Ammo
Reply With Quote #2

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 ] )
    }

__________________
- tired and retired -
ConnorMcLeod is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-14-2009 , 14:58   Re: Unlimited Clip Ammo
Reply With Quote #3

Okay its now updated thanks
__________________
-Acid- is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-16-2009 , 18:06   Re: Unlimited Clip Ammo
Reply With Quote #4

When is this going to be to be check by a plugin approve??
__________________
-Acid- is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-16-2009 , 18:09   Re: Unlimited Clip Ammo
Reply With Quote #5

Quote:
Originally Posted by -Acid- View Post
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.
__________________
"There is no knowledge, that is not power"
fezh is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-16-2009 , 18:14   Re: Unlimited Clip Ammo
Reply With Quote #6

oh i see
__________________
-Acid- is offline
C.H.U.D.
BANNED
Join Date: Apr 2008
Location: Long Island, NY
Old 06-17-2009 , 08:42   Re: Unlimited Clip Ammo
Reply With Quote #7

This plugin is much better
http://forums.alliedmods.net/showthread.php?t=26991
C.H.U.D. is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-17-2009 , 15:44   Re: Unlimited Clip Ammo
Reply With Quote #8

Quote:
Originally Posted by C.H.U.D. View Post
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.
__________________
-Acid- is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-17-2009 , 15:59   Re: Unlimited Clip Ammo
Reply With Quote #9

Quote:
Originally Posted by -Acid- View Post
you have to set the players unlimited ammo every time they connect.
Awesome, could you add this feature in your plugin ?
__________________
- tired and retired -
ConnorMcLeod is offline
C.H.U.D.
BANNED
Join Date: Apr 2008
Location: Long Island, NY
Old 06-17-2009 , 16:03   Re: Unlimited Clip Ammo
Reply With Quote #10

Quote:
Originally Posted by -Acid- View Post
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
C.H.U.D. is offline
Reply


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


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