AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Full Infinite Ammo (https://forums.alliedmods.net/showthread.php?t=143739)

Tylerst 11-24-2010 07:08

[TF2] Full Infinite Ammo
 
1 Attachment(s)
Old Plugin, new one here:Advanced Infinite Ammo




TF2 Full Infinite Ammo

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

I made this plugin specifically for TF2 to do more than just infinite ammo/clip like most other infinite ammo plugins.

List of features:
* Infinite Ammo/Clip: Can shoot infinitely
* Infinite Scout Crit-a-cola/Bonk!/Soda Popper Hype
Note: Since the Scout Bonk! lasts forever under infinite ammo I added a Right-click(+attack2) option to manually remove it
* Infinite Soldier Rage: Rage will last for the normal duration, then recharges to 100% when it reaches 0
* Infinite Pyro MMMPH:Same as soldier rage
* Infinite Pyro Manmelter Crits
* Infinite Demoman Shield Charge: Infinite Charge with Shield Equipped\
* Infinite Demoman Ultrapool Caber(Credit to psychonic - MORE BOOM)
* Infinite Engineer Metal/Sentrygun Ammo
* Infinite Uber/Kritz/QuickFix Uses: Uber/Krits/Quickfix will last for the normal duration, then recharges to 100% when it reaches 0
* Infinite Jarate/Sandman Balls/Sandviches/Madmilk/etc
* Infinite Spy Cloak/Dead Ringer/Instant Recharge Spy-cicle
* Infinite Revenge Crits for Frontier Justice/Diamondback
* Infinite Heads/Decapitations: Infinite count for demoman heads(Like the Eyelander) and sniper headshots(Like the Bazaar Bargain)


CVARs(Default Values Shown):
sm_fia_version "2.2.6_Final"
sm_fia_all "0"- Enable/Disable '1/0' Infinite Ammo for everyone
sm_fia_chat "1" - Enable/Disable Showing ammo changes in chat
sm_fia_log "1" - Enable/Disable Logging of ammo changes
sm_fia_batammo "1" - AdminOnly/All/Disable '2/1/0' infinite sandman/wrap assassin balls
sm_fia_adminonly "0" - Enable/Disable '1/0' admin only for infinite ammo - Will allow infinite ammo to admins with b flag(Generic Admin) and may be overidden with sm_fia_adminflag in admin_overrides.cfg
sm_fia_roundwin "0" - Enable/Disable '1/0' Infinite Ammo on round win
sm_fia_waitingforplayers "0" - Enable/Disable '1/0' Infinite Ammo during Waiting For Players

Commands:
sm_fia "target" "1/0": Set Infinite Ammo for target(s) on/off -- Default Slay Flag
sm_fia2 "target" "duration(in seconds)": Give Infinite Ammo to target(s) for a limited time -- Default Slay Flag
sm_full_infinite_ammo "target" "1/0": Set Infinite Ammo for target(s) on/off -- Default Slay Flag
sm_full_infinite_ammo_timed "target" "duration(in seconds)": Give Infinite Ammo to target(s) for a limited time -- Default Slay Flag

Examples for sm_fia and sm_full_infinite_ammo:
sm_fia Thetarget 1
sm_fia @me 1
sm_fia @bots 1
sm_full_infinite_ammo @humans 1
sm_full_infinite_ammo @blue 1
sm_full_infinite_ammo @blue 0
..etc

Examples for sm_fia2 and sm_full_infinite_ammo_timed:
sm_fia2 Thetarget 10
sm_fia2 @me 5
sm_fia2 @bots 30
sm_full_infinite_ammo_timed @humans 300
sm_full_infinite_ammo_timed @blue 13.37
sm_full_infinite_ammo_timed @all 3.14
..etc


Changelog
Code:

Version 2.0.0 - June 30, 2011
* Initial Release of 2.0.0(complete re-write of 1.x.x version)
* Added infinite sentry ammo for engineers with infinite ammo
* Made use of AskPluginLoad2 to check the game instead of using my own function
* Moved most of the offset initilizations to OnPluginStart instead of inside OnGameFrame
* Made avid use of switch statements where possible
* Used classname to check for mediguns and the sandman instead of the weapon index
* Changed global IA switch to a bool
* The sm_fia_all cvar now uses the global variable instead of it's own variable, this will allow turning IA off on someone even when sm_fia_all is set to 1
* Lots of small optimizations for where things are initialized/used 
 
Version 2.0.2 - July 29, 2011
*Added admin only cvar
*Sandman cvar can now be set to 2 for admin only
 
Version 2.0.3 - July 29, 2011
*Adjusted Adminonly cvar to use checkcommandaccess on sm_fia
*sm_fia_all will now show infinite ammo for admins enabled message instead of everyone when sm_fia_adminonly is enabled(unchanged for turning sm_fia_all off)
*sm_fia_all change messages will now obey sm_fia_chat cvar setting
 
Version 2.0.5 - August 4, 2011
*Added Infinite ammo for Cow Mangler and Bison
 
Version 2.0.7 - August 7, 2011
*Added back roundwin cvar from the 1.0.0 release
 
Version 2.0.8 - August 18, 2011
*Changed serveral bits of coding to use SetEntProp vs SetEntData
 
Version 2.0.9 - August 21, 2011
*Changed adminonly checks to be configurable with overrides
*Added infinite revenge crits for Engineer's Frontier Justice and Spy's Diamondback
 
Version 2.1.0 - September 2, 2011
*Changed returns to continues in for loop
*Removed player array on roundwin bool
 
Version 2.1.1 - November 3, 2011
* Fixed bug with Widowmaker, was setting metal to 99
* Minor code changes
 
Version 2.1.2 - December 17, 2011
*Pomson 6000 now has infinite ammo
*Phlogistinator MMMPH now recharges when depleted(like soldier rage)
*Spy-cicle now regenerates instantly
*Moved class specific weaponindex checks to the switch

Version 2.1.3 - December 17, 2011
*Small update, forgot to give manmelter infinite crit shots

Version 2.1.4 - December 19, 2011
*Small update to fix a bug with the spy-cicle

Version 2.2.0 - December 24, 2011
*sm_fia_sandman changed to sm_fia_batammo, will now affect both the sandman and wrap assassin
*Added fia2 command for timed infinite ammo

Version 2.2.1 - January 9, 2012
*Fixed a bug with using the sm_fia command on a target not fully loaded into the game or not alive

Version 2.2.2 - January 22, 2012
*Added Valid Entity check for spy knife to prevent errors where the knife isn't valid such as wepaon removal

Version 2.2.3 - March 18, 2012
*Added Infinite Heads for demoman/sniper

Version 2.2.4 - March 20, 2012
*Added cvar for infinite ammo during Waiting For Players
*Added 2 alternate, more descriptive commands

Version 2.2.5 - June 29, 2012
*Added Infinite Focus for Hitman's Heatmaker and Infinite Boost for Baby Face's Blaster
*Few small code changes

Version 2.2.6_Final - July 19, 2012
*Fixed all Sniper Rifles receiving focus effects of the Hitman's Heatmaker



Changelog(Old):
Code:

Version 1.0.0 - November 24, 2010
* Initial release.
 
Version 1.1.0 - November 25, 2010
* Added Admin Command by request along with chat/log cvars
* Changed sm_fia_enable to sm_fia_all
 
Version 1.1.1 - November 26, 2010
* Added code to remove infinite ammo on disconnect as a preventative bug measure
 
Version 1.1.2 - November 27, 2010
* Changed Soldier Rage to the same setup as Medic Uber,
after adding the command it made the orginal rage method useless.
* Added Code to set infinite ammo off on player connections
 
Version 1.1.3 - November 27, 2010
* Small coding change(bug fix)
 
Version 1.1.4 - December 03, 2010
* Another small coding change
 
Version 1.1.5 - December 12, 2010
* Added valid entity check on active weapon(for civilian exploit, but probably also needed for remove weapon plugins)
 
Version 1.2.0 - February 5, 2011
* Added cvar sm_fia_sandman to disable infinite sandman balls(by request)
* Changed some coding to improve performance a bit
 
Version 1.2.1 - February 15, 2011
* Moved sandman check out of scout only area, and changed to a weapon check instead of an index check
 
Version 1.2.2 - February 16, 2011
* Update to fix bonk/crit-a-cola with sandman cvar
 
Version 1.3.0 - February 27, 2011
* Added Infinite Ultrapool Caber(credit to psychonic)
* Changed infinite charge code and added cvar
 
Version 1.3.3 - June 27, 2011
* Added Quick fix to list of mediguns
* Added Infinite Hype
* Changed condition checks to use the new TF2_IsPlayerInCondition stock
* Changed infinite charge to use the new m_flChargeMeter property
* Removed the infitarge cvar as a result of the previous point
 
Version 1.3.4
* Fixed small typos in the cvars, nothing that would affect the working of the plugin if you're using 1.3.3

Things I won't be adding:
Infiniite Buildings for Engineers: far too laggy, and you can do this yourself with other plugins
Infinite Deployed Stickys for Demoman: also laggy
(Both of these would likely require an extension as well).

thatdarnkid 11-24-2010 13:37

Re: [TF2] Full Infinite Ammo
 
I'd download this, but as you've said in your list of things you won't add:

Quote:

Originally Posted by Tylerst (Post 1355623)
Infinite Ammo For Single Targets or Admins Only: Mostly because I prefer all or noone with Infinite Ammo, and also due to laziness. :P

Other people prefer being able to set Infinite Ammo/etc on one person/admins only. Also quit being lazy :P

If you want more people to download this, add in the single target/admin only feature.

By the way, I take it this plugin comes with instructions on how to add the plugins features to the SourceMod sm_admin menu?

Tylerst 11-24-2010 23:39

Re: [TF2] Full Infinite Ammo
 
Quote:

Originally Posted by thatdarnkid (Post 1355813)
I'd download this, but as you've said in your list of things you won't add:



Other people prefer being able to set Infinite Ammo/etc on one person/admins only. Also quit being lazy :P

If you want more people to download this, add in the single target/admin only feature.

By the way, I take it this plugin comes with instructions on how to add the plugins features to the SourceMod sm_admin menu?

Very well then..:wink:
Added the admin command to allow on/off on single or multiple targets.

As far as Admin Menu for the features...the features are a part of the infinite ammo, not indiviual things, you set infinite ammo and the target(s) recieve all of those things.

thatdarnkid 11-25-2010 13:32

Re: [TF2] Full Infinite Ammo
 
Beautiful. Just installed and tested the plugin. Nice work.

This should be moved to approved plugins. Everything has infinite ammo. Some weapons even gain abit of a rapid fire trait from this (such as the Lugermorph, that gun is a beast with infinite ammo on).

Now the only thing I have to do is figure out how to properly add the commands for this plugin to my sm_admin menu. As for adding in a player selection submenu for most of the commands (infinite ammo on/off, etc), I guess I'm gonna be taking a shot in the dark.

thatdarnkid 11-25-2010 16:36

Re: [TF2] Full Infinite Ammo
 
sm_fia_all "0" doesn't seem to work at all. Keeps giving me an Unknown Command thing

Tylerst 11-25-2010 18:27

Re: [TF2] Full Infinite Ammo
 
1 Attachment(s)
Quote:

Originally Posted by thatdarnkid (Post 1356598)
sm_fia_all "0" doesn't seem to work at all. Keeps giving me an Unknown Command thing

sm_fia_all is a cvar not an admin command, if you want to change it from the game you need to use
sm_rcon sm_fia_all 1/0 or sm_cvar sm_fia_all 1/0

As far as an admin menu, heres a short simple example with Set Infinite Ammo in the player commands and infinite ammo all in server commands

thatdarnkid 11-25-2010 19:40

Re: [TF2] Full Infinite Ammo
 
Quote:

Originally Posted by Tylerst (Post 1356663)
sm_fia_all is a cvar not an admin command, if you want to change it from the game you need to use
sm_rcon sm_fia_all 1/0 or sm_cvar sm_fia_all 1/0

As far as an admin menu, heres a short simple example with Set Infinite Ammo in the player commands and infinite ammo all in server commands

Ahhhh. You are the man.

Thanks for the admin menu thingamajigger :D

Onedda 11-26-2010 04:16

Re: [TF2] Full Infinite Ammo
 
Only tried this yesterday, its pretty good but don't know if any one else has had this but a random player had to disconnect as he had info ammo even though i never put it on him ? is it a bug or just 1 of those things?

SM 1.4.0
MM1.9.0
Windows server

cheers
Onedda

Tylerst 11-26-2010 04:42

Re: [TF2] Full Infinite Ammo
 
Quote:

Originally Posted by Onedda (Post 1356878)
Only tried this yesterday, its pretty good but don't know if any one else has had this but a random player had to disconnect as he had info ammo even though i never put it on him ? is it a bug or just 1 of those things?

SM 1.4.0
MM1.9.0
Windows server

cheers
Onedda

Going back over my code I can only take a guess.
This part of the code:
Code:

if (ison || fiammo[i])
is suppose to prevent anyone who doesn't have infinite ammo from receiving it, sm_fia_all and sm_fia_roundwin switch the ison to allow infinite ammo for everyone, and fiammo[i] checks for individual allowances from the command.

The best I can guess is that you enabled infinite ammo on someone, they left, then someone entered and took their spot, giving that person infinite ammo.

I added code to set infinite ammo on a client to 0 on disconnect

Code:

public OnClientDisconnect(client)
{
    fiammo[client] = 0;
}


Please try it out and tell me if it happens again :)

thatdarnkid 11-26-2010 22:26

Re: [TF2] Full Infinite Ammo
 
I've had the same problem on my server. People were randomly being granted infinite ammo, leading me to have to go through each person one by one and turn infinite ammo off for each of them.

I've had to go through one-by-one because the command for turning infinite ammo off for everyone doesn't seem to work.

EDIT: Just received a message from my server host, about a support question I asked them (in regards to people not being able to join my server:

Quote:

I took a look at your server and there were two things that I noticed:

1. A LOT of errors from an infinite ammo plugin that you were running - I moved it to the disabled plugins folder since the logfile was 15MB filled only with errors from that plugin. I strongly suggest that you find something else that can offer the same functionality on the sourcemod forums.

2. You had logging off in the server.cfg, I turned it on so I can get a better idea of what's actually happening when people are connecting. I'll check again later to see what turns up.


All times are GMT -4. The time now is 18:28.

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