View Single Post
Author Message
Tylerst
Veteran Member
Join Date: Oct 2010
Old 07-20-2012 , 01:45   [TF2] Advanced Infinite Ammo
Reply With Quote #1

Advanced Infinite Ammo

Description: Give Infinite Ammo/Clip/and more to everyone in game or on a specific target(s)

List of features:
* Infinite Ammo/Clip
* Infinite Crit-a-cola/Bonk! Note: Right-click(alt-fire) to manually remove bonk!
* Infinite Hype
* Infinite usage for Rage based weapons(Banners, Phlog, etc)
* Beggar's Bazooka - Hold right-click(alt-fire) to fire infinite rockets
* Infinite Manmelter/Frontier Justice/Diamondback Crits (Shoot once to activate)
* Infinite Shield Charge
* Infinite Ullapool Caber
* Infinite Metal/Sentrygun Ammo
* Infinite usage for Uber/Kritz/QuickFix
* Infinite Jarate/Sandman Balls/Sandviches/Madmilk/etc
* Infinite Cloak/Dead Ringer/Instant Recharge Spy-cicle
* Infinite Heads/Decapitations
* Infinite Spell Uses(Press reload to remove current spell)


CVARs(Default Values Shown: 1 = Enabled, 0 = Disabled):
Note: The plugin automatically creates AdvancedInfiniteAmmo.cfg at tf/cfg/sourcemod
Change the default values there.

sm_aia_version "1.5.3"

sm_aia_all "0" - Advanced Infinite Ammo for everyone(and will automatically give it to anyone who connects)
sm_aia_adminonly "0" - Advanced Infinite Ammo will work for admins only, 1 = Completely admin only, 2 = Admin only but the commands will work on non-admins
-Default "b" flag - Can be overridden with sm_aia_adminflag
sm_aia_bots "1" - Advanced Infinite Ammo will work for bots
sm_aia_roundwin "1" - Advanced Infinite Ammo for everyone on round win
sm_aia_waitingforplayers "1" - Advanced Infinite Ammo for everyone during waiting for players phase
sm_aia_chat "1" - Show Advanced Infinite Ammo changes in chat
sm_aia_log "1" - Log Advanced Infinite Ammo commands
sm_aia_disabledweapons "" - Weapons indexes to not give infinite ammo, separated by semicolons(Do not add spaces) --eg. sm_aia_disabledweapons "44;58;222" would disable sandman, jarate and mad milk

sm_aia_clip "1" - Infinite Clip will be globally disabled
sm_aia_ammo "1" - Infinite Ammo will be globally disabled
sm_aia_extrastuff "1" - Infinite Extra Stuff will be globally disabled
sm_aia_metal "1" - Infinite Metal will be globally disabled
sm_aia_sentryammo "1" - Infinite Sentry Ammo will be globally disabled
sm_aia_cloak "1" - Infinite Cloak will be globally disabled
sm_aia_spells "1" - Infinite Spells will be globally disabled

Commands:
sm_aia "target" "1/0" - Give Advanced Infinite Ammo to the target(s) (Can auto-target self with just sm_fia)
sm_aia2 "target" "time(in seconds)" - Give Advanced Infinite Ammo to the target(s) for a limited time
sm_advanced_infinite_ammo "target" "1/0" - Same as sm_aia
sm_advanced_infinite_ammo_timed "target" "time(in seconds)" - Same as sm_aia2
sm_aiamenu - Open menu to choose target's AIA capabilities(flags globally disabled by the cvars cannot be changed)
Note: Can override sm_aia_targetflag to control which admins can target others

Command Usage Examples:
sm_aia -Toggle AIA on yourself
sm_aia Bob 1 -Enable AIA on Bob
sm_aia @all 1 -Enable AIA on everyone
sm_aia @red 1 -Enable AIA on red team
sm_aia @!me 0 -Disable AIA for everyone except yourself
(sm_advanced_infinite_ammo can be used in place of sm_aia)

sm_aia2 @me 10 - Give yourself AIA for 10 seconds
sm_aia2 Bob 30 - Give Bob AIA for 30 seconds
sm_aia2 @all 300 - Give everyone AIA for 5 minutes
(sm_advanced_infinite_ammo_timed can be used in place of sm_aia2)

Changelog
Code:
Version 1.0.0 - July 20, 2012
* Initial Release

Version 1.0.1 - July 20, 2012
* Added sm_aia_targetflag override to set which admins can target others
* Fixed a typo in the self target part

Version 1.0.2 - July 27, 2012
* Beggar's Bazooka now has a hold right-click(alt-fire) option for firing infinite rockets
* Reverted Bonk!/Crit-A-Cola to old plugin behavior(Infinite duration+right click[alt-fire] to remove Bonk!)
* Moved the Sandman/Wrap Assassin to their own case to make it a bit simpler to enable the admin check, or disable them altogether
* August 1, 2012 Fixed sm_aia_adminonly being 1 by default, No version change

Version 1.1.0 - August 4, 2012
* Plugin now uses SDKHooks
* Added weapon indexes from The Triad Pack
* Fixed plugin not detecting arena round start

Version 1.1.1 - August 7, 2012
* Added sm_aia_bots cvar to control whether bots can receive Advanced Infinite Ammo
* Changed validation code a bit to fix errors

Version 1.1.2 - August 16, 2012
* Fixed plugin not detecting mvm wave start

Version 1.2.0 - December 13, 2012
*Code cleanup in a few areas(Such as caching cvars instead of using GetConVar* in a for loop)
*Updated item indexes
*Can now set sm_aia_ammoonly to set ammo instead of clip(Must still reload weapon)
*Can now set sm_aia_extrastuff to allow/disallow extra things such as ubercharge/rage/hype/etc off to only have ammo related things
*Can now set sm_aia_adminonly to 2 to allow the admin command to work on non-admins

Version 1.2.1 - December 13, 2012
*Small update, I forgot to add silver/gold botkiller weapons in 1.2.0(Thanks to raygius for messaging me)

Version 1.2.2 - December 21, 2012
*Updated for new item indexes

Version 1.2.3 - January 6, 2013
*Sappers now infinite in MvM

Version 1.2.4 - January 7, 2013
*Added infinite sniper rifle charge meter(with extrastuff enabled)

Version 1.2.5 - January 9, 2013
*Added better late load support

Version 1.2.6 - January 21, 2013
*Added infinite rage for Heavy Miniguns in MvM(with extrastuff enabled)
*Added Festive Minigun index(No idea why, but I found out it was missing when adding the above code)

Version 1.2.7 - January 24, 2013
*Added Infinite Razorback(Thanks to FlaminSarge for the method idea)

Version 1.2.8 - March 01, 2013
*Fixed Festive Ambassador and Festive Grenade launcher being in ammo section instead of clip section(Thanks to rayguis for pointing it out)

Version 1.2.9 - May 27, 2013
*Added Ap-Sap and Ham Shank indexes
*Moved Flamethrowers into the Only Ammo category(They no longer need clip set for airblast ammo)

Version 1.3.0 - October 13, 2013
*Fixed waitingforplayers cvar not removing infinite ammo if it was changed during waitingforplayers
*Changed Crusader's Crossbow to ammo mode until Valve decides to fix it's rapid fire with a clip size higher than 1
*Changed Event hooks to EventHookMode_PostNoCopy since the plugin doesn't need to retrieve any values from them
*Non-plugin related, removed SDKhooks link and compiled plugin since sdkhooks now comes with sourcemod as of 1.5 and will compile on the forum

Version 1.3.1 - November 3, 2013
*Added Infinite Spell Uses(Press reload to remove current spell)
*Added Automatic config creation(AdvancedInfiniteAmmo.cfg in tf/cfg/sourcemod/)

Version 1.3.3 - November 5, 2013
*Fixed an error that would occur if no players had a spellbook equipped

Version 1.3.4 - December 3, 2013
*Fixed AutoExecConfig creating AdvancedInfiniteAmmo.cfg.cfg
*Added Infinite Medic Shield(MvM) with extra stuff cvar enabled
*Changed SetAmmo from 999 to 500 to fix a console spam error related to the heal target ammo counter

Version 1.3.5 - December 14, 2013
*Added cvar sm_aia_disabledweapons to control which weapon indexes should not get infinite ammo
*Added Golden Frying Pan index to melee case

Version 1.3.6 - December 19, 2013
*Fixed disabled weapons cvar not working for spellbooks

Version 1.3.7 - June 19, 2014
*Added newer Item Indexes

Version 1.3.8 - June 28, 2014
*Slight code change to check for Valid Weapon

Version 1.3.9 - June 29, 2014
*Updated game check code
*Fixed Hitman's Heatmaker and Bazaar Bargain not getting full charge damage

Version 1.4.0 - July 17, 2015
*Revamp of plugin to 1.7 syntax
*Sorted wepaon index section by class and slot and updated indexes
*Changed Sentry Infinite Ammo to use the games built in Infinite ammo flag rather than forcing it in OnPreThink(should improved performance)

Version 1.4.1 - July 17, 2015
*Changed OnClientPutInServer to OnClientPostAdminCheck

Version 1.4.2 - July 17, 2015
*Added item indexes 15000-15059(Thanks to xXDeathreusXx and abrandnewday for notifying me)

Version 1.4.3 - July 19, 2015
*Changed Sentry ammo code to use OnEntityCreated Instead of the build event 
*Sentry code now adds/removes the ammo flag with the current flags taken into account instead of overwriting them.

Version 1.4.4 - July 19, 2015
*Fixed a few bugs with new sentry code

Version 1.4.5 - July 28, 2015
*Fixed sniper bow indexes(separated them from rifles)

Version 1.4.6 - July 29, 2015
*Fixed LochNLoad/AliBaba'sWeeBooties indexes being switched.

Version 1.5.0 - August 2, 2015
*New command sm_aiamenu to control target's AIA capabilities and Cvars to allow global disabling
*Removed curent sm_aia_extrastuff and sm_aia_ammonly due to above change
*Added new natives for use in other plugins(see include file)

Version 1.5.1 - September 14, 2015
* Small bit of code change to fix errors in 1.8 compiler(No functional difference from 1.5.0)

Version 1.5.2 - October 3, 2015
*Fixed global ammoflags not properly being enabled/disabled properly if plugin/config file matched.

Version 1.5.3 - October 7, 2015
*Added the 4 Invasion weapon indexes
Attached Files
File Type: inc advancedinfiniteammo.inc (2.0 KB, 5565 views)
File Type: sp Get Plugin or Get Source (AdvancedInfiniteAmmo.sp - 13378 views - 41.1 KB)

Last edited by Tylerst; 10-07-2015 at 10:05.
Tylerst is offline