Raised This Month: $51 Target: $400
 12% 

[TF2] Gimme (v1.20 - 03 May 2023)


Post New Thread Reply   
 
Thread Tools Display Modes
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-02-2022 , 18:27   Re: [TF2] Gimme (v1.6 02 Jan 2022)
Reply With Quote #11

Plugin in original post updated to version 1.6

New version fixes a bug that prevented certain classes from equipping a shotgun. It also now prevents players from giving themselves primary and secondary weapons on medieval mode maps.

This version introduces an index limit of 49,999 that players can give themselves with the !gimme command. They are allowed to equip any item as long as it has an index number less than 50,000. Custom items in the tf2items.givecustom.txt file that have an index number of 50,000 or higher can only be given to players with the !giveitem command.

This version also adds a command for players to check the item indexes and name of equipped items. Admins can check the indexes and name of equipped items of any player. You can change the admin overrides setting for "sm_checkitems" to allow any player to check the equipped items of any player.

Note: The check item command won't show the custom item index number, it will instead show the index number of the actual equipped item.

I'm exploring the possibility of adding a save items feature. It's far more complicated than it sounds, especially for a hobbyist plugin writer. My test version is pretty ugly with multidimensional arrays. If anyone already built a good version that saves items feel free to post it. Until then I'll keep working on it.

I'm also exploring the possibility of adding a 'clone' feature. My thought is that if you see a loadout you want you could just use a command to equip yourself with their current loadout.

Last edited by PC Gamer; 01-03-2022 at 07:29.
PC Gamer is offline
xiaoli
Junior Member
Join Date: Jan 2022
Location: Hong Kong
Old 01-03-2022 , 11:18   Re: [TF2] Gimme (v1.6 02 Jan 2022)
Reply With Quote #12

Quote:
Originally Posted by PC Gamer View Post
Plugin in original post updated to version 1.6

New version fixes a bug that prevented certain classes from equipping a shotgun. It also now prevents players from giving themselves primary and secondary weapons on medieval mode maps.

This version introduces an index limit of 49,999 that players can give themselves with the !gimme command. They are allowed to equip any item as long as it has an index number less than 50,000. Custom items in the tf2items.givecustom.txt file that have an index number of 50,000 or higher can only be given to players with the !giveitem command.

This version also adds a command for players to check the item indexes and name of equipped items. Admins can check the indexes and name of equipped items of any player. You can change the admin overrides setting for "sm_checkitems" to allow any player to check the equipped items of any player.

Note: The check item command won't show the custom item index number, it will instead show the index number of the actual equipped item.

I'm exploring the possibility of adding a save items feature. It's far more complicated than it sounds, especially for a hobbyist plugin writer. My test version is pretty ugly with multidimensional arrays. If anyone already built a good version that saves items feel free to post it. Until then I'll keep working on it.

I'm also exploring the possibility of adding a 'clone' feature. My thought is that if you see a loadout you want you could just use a command to equip yourself with their current loadout.
multi-dimensional arrays, it is not unoptimized, it's best option.
alternatives are clientprefs cookies (slow), storing everything in single string (even slower!)

multi-dimensional array uses more memory but at bonus of faster processing speed which is the best trade-off for single core game like TF.

1 int/integer = 4 bytes
33 players * 9 * 10 (9 classes, 5 cosmetics, 5 weapons) = 3 kilobytes (2970 bytes) or so of data used for server.

consider that we have gigabytes of ram and 3 kilobytes it's not even 1% of 1 megabyte that we are storing here

it will be fine
__________________
善有善报。
xiaoli is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 01-04-2022 , 12:42   Re: [TF2] Gimme (v1.6 02 Jan 2022)
Reply With Quote #13

I use mysql on a heavily populated server 33/33 24/7 map. (3 different servers)

I am able to use a mysql database. (phpMyAdmin).

Code:
	"unusuals"
	{
	    	"driver"                "mysql"
		"host"			"127.0.0.1"
		"database"		"xxxxxxxxxxxxxx"
		"user"			"root"
		"pass"			""
		//"timeout"		"0"
		"port"			"3306"
	}
__________________

Last edited by ph; 01-04-2022 at 13:14.
ph is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-05-2022 , 06:26   Re: [TF2] Gimme (v1.7 05 Jan 2022)
Reply With Quote #14

Plugin in original post updated to version 1.7

New version provides an updated include file to support plugin developers. See include file for documentation.

This version also fixed a bug that prevented some commands from being overridden with Admin Overrides.

The coolest feature of this version are the new clone commands. Players can clone another player. Admins can clone a source player to multiple target players. You'll have fun making the entire team look exactly like you.
PC Gamer is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-07-2022 , 04:47   Re: [TF2] Gimme (v1.8 07 Jan 2022)
Reply With Quote #15

Plugin in original post updated to version 1.8

New version provides the much requested feature of permanent items.

The !gimmep command allows you to give yourself an item permanently. That item will be given to you whenever you spawn or touch a locker. You can keep using the !gimmep command up to 12 times to give yourself multiple items.

The permanent item status will be removed when you change class or use the !resetp command.

Admins can target multiple players with the !giveitemp command. Example: !giveitemp 666 @bots
Admins can remove permanent items from multiple players with the !removep command. Example: !removep @all

Note: Players won't be able to access the !gimmep or !resetp command unless you add them to the Admin Overrides config file. Addictionally, the command is disabled by default with a convar. You'll also have to enable the convar by adding this to your server.cfg file or console: sm_gimme_permanent_items_enabled 1

Note2: Use of the Admin command !giveitemp bypasses limitations mentioned in above note.
PC Gamer is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 01-07-2022 , 09:42   Re: [TF2] Gimme (v1.8 07 Jan 2022)
Reply With Quote #16

Brilliant.. many thanks.

Please enable clientprefor mysql functionality so it saves the players ID/settings, allowing them to keep the item permanently and applied automatically on connection.
__________________
ph is offline
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 01-08-2022 , 04:11   Re: [TF2] Gimme (v1.8 07 Jan 2022)
Reply With Quote #17

There is a slight problem with the maximum ammo of the weapon given out if it is not a standard weapon of the class.
In the progenitor of this plugin, I solved this problem through the gamedata.


__________________
Sorry for my English.
Mr_panica is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-08-2022 , 09:53   Re: [TF2] Gimme (v1.9 08 Jan 2022)
Reply With Quote #18

Plugin in original post updated to version 1.9

New version fixes a bug when giving class specific weapons to a different class. The weapons didn't have the correct clip size or ammo amount. That is now fixed in version 1.9.

Thanks Mr_panica for pointing out the bug. It seems that getting the default clipsize and ammo about by weapon is hard to do, since virtually every option I found involved checking the players class, and not the weapon. It turns out that you don't give ammo to the weapon, you give ammo to the player. I checked into using gamedata and found that it would only help with clipsize. Plus, I really didn't want to force server operators to deal with yet another gamedata file.

It ended up being far easier to take a few minutes to hard code clipsize and ammo amounts by weaponclass into the plugin. So that's what I did in version 1.9.

Last edited by PC Gamer; 01-08-2022 at 20:47.
PC Gamer is offline
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 01-09-2022 , 12:32   Re: [TF2] Gimme (v1.9 08 Jan 2022)
Reply With Quote #19

It would be cool if the sm_clone command copied the paint hats, if there are any on the copy target.
And also, it seems like copying hats with an unusual effect does not work, the effect simply does not appear.

Also, this effect will not show up in sm_listitems.

__________________
Sorry for my English.
Mr_panica is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 01-10-2022 , 01:16   Re: [TF2] Gimme (v1.9 08 Jan 2022)
Reply With Quote #20

GITHUB (or GitLab/Bitbucket/w/e)
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
Reply



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:42.


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