Raised This Month: $ Target: $400
 0% 

[TF2] Gimme (v1.14 16 July 2022)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
PC Gamer
Veteran Member
Join Date: Mar 2014
Plugin ID:
7892
Plugin Version:
1.14
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Players can equip any weapon or cosmetic item. Players can clone other players.
Old 12-20-2021 , 22:57   [TF2] Gimme (v1.14 16 July 2022)
Reply With Quote #1

This plugin allows players to give themselves any weapon or cosmetic item. The item is lost when they die or touch a locker unless permanent items are enabled. Admins can give any weapon or item to target players. Existing cosmetics will only be removed if they conflict with the new cosmetic given.

This plugin also allows players to clone other players with the !clone <player> command. This will make you a clone of that player. You will become the same class as the target player. You will have that players weapons and you will be wearing that players cosmetic items. Warpainted weapons and cosmetic effects are also cloned.

Some commands are limited to players with the SLAY flag. Use admin overrides to change the flag to your liking. To do this, edit your amin_overrides.cfg file located in the configs folder. For example, if you want any player to use the gimme command add this line:
Quote:
"sm_gimme" " "
By default the players will only be able to equip weapons and cosmetics for their current class. Server operators can remove those restrictions with the ConVars listed below.

Credits:
FlaminSarge for his amazing tf2items_giveweapon plugin
nosoop for his fantastic econ data plugin
Mr_panica for his method of loading the tf2items_givecustom.txt file
Teamkiller324 for his help with code cleanup

Plugin Dependencies:
Econ Data by nosoop. Here's a link: https://forums.alliedmods.net/showthread.php?t=315011
TF2Attributes by FlaminSarge. Here's a link: https://forums.alliedmods.net/showthread.php?t=210221

ConVars:
sm_gimme_prevent_giving_cosmetics 0 - (default) allows giving cosmetics
sm_gimme_prevent_giving_cosmetics 1 - giving cosmetics is not allowed
sm_gimme_prevent_giving_weapons 0 - (default) allows giving weapons
sm_gimme_prevent_giving_weapons 1 - giving weapons is not allowed
sm_gimme_effects_enabled 0 - (default) weapons given will not have unusual effects
sm_gimme_effects_enabled 1 - weapons will always have unusual effects if weapon allows.
sm_gimme_enforce_class_weapons 0 - players can equip any weapon, even if for another class
sm_gimme_enforce_class_weapons 1 - (default) players can only equip weapons for their current class
sm_gimme_enforce_class_cosmetics 0 - players can equip any cosmetic, even if for another class
sm_gimme_enforce_class_cosmetics 1 - (default) players can only equip cosmetics for their current class
sm_gimme_enforce_class_cloning 0 - players can clone any player class
sm_gimme_enforce_class_cloning 1 - (default) players can only clone other players if they are same class
sm_gimme_permanent_items_enabled 0 - (default) players cannot give themselves permanent items
sm_gimme_permanent_items_enabled 1 - players can give themselves permanent items
sm_gimme_enforce_cosmetic_conflicts 0 - conflicting wearable items are not removed
sm_gimme_enforce_cosmetic_conflicts 1 - (default) conflicting wearable items are removed

Player Commands:
!gimme <item index number > <0 or warpaint id> <0 or unusual effect id> <0 or paint id>
unusual effect numbers are 0-223, or 999. 999 is random
paint ids are 0-29
warpaint ids are 0, 200-297, 300-310, 390, 391

!gimme <item index number> - will equip the item
!gimme <warpaintable weapon index number> <warpaint id> - will equip the weapon with warpaint
!gimme <item index> <0> <unusual effect number> - will equip the item with unusual effect
!gimme <item index> <0> <unusual effect number> <paint id> - will equip item with effect and paint
!gimmep <item index number> will equip the item, and give the item again after every spawn or touch locker unless the player changes class or uses the !resetp command.
!gimmep <warpaintable weapon index number> <warpaint id> - will equip the weapon with permanent warpaint item
!gimmep <item index> <0> <unusual effect number> - will equip the item with permanent unusual effect
!index - will display the web address for the TF2 item definition index wiki
!listitems - will display a list of all of your equipped weapons and cosmetic items
!listitems <target> - will display a list of target player's equipped weapons and cosmetic items
!clone <source> - will make you an clone of the source player
!clonep <source> - will make you a permanent clone of the source player until you reset or change class
!resetp - will remove your permanent items and permanent clone status when you die or touch a locker

Examples:
!gimme 18 - will give player a rocket launcher
!gimme 666 - will give player the B.M.O.C. (santa hat)
!gimme 666 0 0 2 - will give player the B.M.O.C. (santa hat) with no effect painted purple
!gimme 666 0 13 will give player the B.M.O.C. (santa hat) with burning flames unusual effect
!gimme 205 300 - will give player rocket launcher with Yeti warpaint skin
!gimme 205 300 701 - will give rocket launcher with Yeti warpaint skin and hot unusual effect
!gimme 199 232 - will give player a shotgun with Alien Tech warpaint skin
!gimme 205 1 - will give player an australium rocket launcher
!gimmep 581 0 13 - will permanently give the player a Monoculus head with burning flames
!index - will show the url for the item index wiki
!listitems - will show a list of all of your equipped weapons and cosmetic items
!listitems suzy - will show a list of the player named suzy's weapons and cosmetic items
!clone jeff - will make you an clone of the target player named Jeff
!clonep bob - will make you a clone of bob, even if you die or touch a locker
!resetp - will remove permanent items with you die or touch locker
note: warpainted weapons require the renamed/strange variant of the weapon. ie., 199 for shotgun

Admin Commands:
!giveitem <target player> <item index number>
!giveitem <target player> <warpaintable weapon index number> <warpaint id>
!giveitem <target player> <item index number> <0> <unusual effect number>
!giveitemp <target player> <item index number> <0> <unusual effect number> (gives permanent item)
!listitems <target player>
!cloneothers <target players> <source player>
!cloneothersp <target players> <source player> (makes the cloned items reapply on death or locker touch)
!removep <target player> (removes permanent items from target when they die or touch locker)
!listp (debugging command to see which permanent items you have given to yourself)
!stripall (targets) - Removes model from target player. Removes all cosmetics and wearable items, spellbook, and grappling hook from the target player. Removes all player weapons and replaces them with their class appropriate stock weapons.
!stripitems (targets) - Same as !stripall but only removes cosmetic and wearable items.
!stripweapons (targets) - Same as !stripall but only removes and replaces weapons.
!regen (targets) - Will regenerate the player the same as if they touched a resupply locker. Useful if you want to return the player to their originally equipped items.

Video of Gimme Plugin:


Installation:
Put gimme.smx into the folder: /sourcemod/plugins/
The gimme.sp and gimme.inc are optional. They are provided for plugin developers.
Change map

Note: This plugin is compatible with the tf2items.givecustom.txt file from the tf2items_giveweapon plugin. Custom items and attributes are supported but custom models and viewmodels are not supported. Please see the TF2Items_GiveWeapon plugin for details on creating custom weapons. Here's a link: https://forums.alliedmods.net/showthread.php?p=1337899

Note2: Players can only give themselves items with an index below 50,000. If you want to prevent players from certain custom items give the custom item in your tf2items.givecustom.txt file a number of 50,000 or higher.

Note3: You can give yourself up to 12 permanent items. If the latest item conflicts with a previous item the previous item will be removed. All items are given to you every time you spawn or touch a locker. This will continue to happen until you change class or use the !resetp command (or Admin uses !removep command on player).

Note4: You can edit the sourcecode to added banned items by item index. Look for the banneditems[x] array near the top of the code and add your item index. Next, increment the x array count by one.

Changelog:
1.14 - 16Jul2022: Added convars to enable/disable giving of cosmetics or weapons
1.13 - 13Feb2022: Added code from TeamKiller324. Thanks! Added SM 1.11 compatibility.
1.12 - 17Jan2022: Fixed non custom weapon ammo bug. Fixed demo shield removal bug.
1.11 - 16Jan2022: Fixed paint bug. Added requested features. Added banned items. Thanks AfonsoTheEnthusiast!
1.10 - 12Jan2022: Added paint. Cloning is much improved.
1.9 - 08Jan2022: Fixed an ammo bug when giving class weapons to different classes. thanks Mr_panica!
1.8 - 07Jan2022: Added permanent items with the !gimmep, !giveitemp commands.
1.7 - 05Jan2022: Remade include file. Added Unusual Effects. Added Clone commands.
1.6 - 02Jan2022: Fixed Shotgun bug. Added list commands. Added custom item restriction. Added Medieval mode weapon restrictions.
1.5 - 23Dec2021: Code cleanup. Thanks Teamkiller324!
1.4 - 22Dec2021: Fixed a bug where custom ammo amount wasn't being applied to custom weapons.
1.3 - 22Dec2021: Fixed conflicting cosmetic bug. Added include file and natives for developers.
1.2 - 21Dec2021: Added basic support for custom weapons in tf2items.givecustom.txt file.
1.1 - 20Dec2021: Admin usage of !giveitem will now ignore weapon and cosmetic class restrictions.
1.0 - 20Dec2021: Initial release.
Attached Files
File Type: inc gimme.inc (1.5 KB, 264 views)
File Type: sp Get Plugin or Get Source (gimme.sp - 45 views - 94.0 KB)
File Type: smx gimme.smx (36.9 KB, 94 views)

Last edited by PC Gamer; 07-16-2022 at 14:47.
PC Gamer is offline
throwaway12812391
New Member
Join Date: Sep 2021
Old 12-21-2021 , 01:52   Re: [TF2] Gimme
Reply With Quote #2

Great plugin! Could you add the custom items config from FlaminSarge's TF2 Give Weapon and make the admin commands bypass the class restriction cvars? Thanks for your work!
throwaway12812391 is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 12-21-2021 , 02:31   Re: [TF2] Gimme
Reply With Quote #3

Quote:
Originally Posted by throwaway12812391 View Post
Great plugin! Could you add the custom items config from FlaminSarge's TF2 Give Weapon and make the admin commands bypass the class restriction cvars? Thanks for your work!
Plugin in original post updated to version 1.1

At your request the Admin command of !giveitem will now ignore weapon and cosmetic class restrictions.

I am undecided about adding a 'custom weapons' feature to this plugin as I really don't use it. However, I do understand the value of feature parity so I will at least explore the option.
PC Gamer is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 12-21-2021 , 20:48   Re: [TF2] Gimme (v1.2 21 Dec 2021)
Reply With Quote #4

Plugin in original post updated to version 1.2

New version adds support for custom items if you have a tf2items.givecustom.txt file in your configs folder. It does not support custom models or viewmodels.

This file is not required unless you want custom created items. See the tf2items_giveweapon plugin information on how to create the file. Here's a link: https://forums.alliedmods.net/showthread.php?p=1337899

Here's a basic example of tf2items.givecustom.txt :
PHP Code:
"custom_give_weapons_vlolz"
{
    
"9999" //Overpowered RocketLauncher
    
{
        
"classname"        "tf_weapon_rocketlauncher"
        "index"        "15150"
        "slot"        "0"
        "quality"        "6"
        "level"        "29"
        "attribs"        "134 ; 702.0 ; 2 ; 10.0 ; 6 ; 0.1 ; 4 ; 6.0 ; 57 ; 30.0 ; 318 ; 0.1"
        "ammo"        "450"
    
}

Enjoy!
PC Gamer is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 12-22-2021 , 17:38   Re: [TF2] Gimme (v1.3 22 Dec 2021)
Reply With Quote #5

Plugin in original post updated to version 1.3

New version provides an include file to support plugin developers. See include file for documentation. Also fixed a bug when checking for any conflicting cosmetics.

Note: I'm a hobbyist plugin writer and not a programmer by trade. If you find ways to improve the code feel free to let me know. I'm eager to learn and my feelings won't be hurt.
PC Gamer is offline
Teamkiller324
Senior Member
Join Date: Feb 2014
Location: m_bTeamKiller
Old 12-23-2021 , 09:32   Re: [TF2] Gimme (v1.4 22 Dec 2021)
Reply With Quote #6

a slightly modified version with few updated syntax declarations
Attached Files
File Type: sp Get Plugin or Get Source (gimme.sp - 39 views - 29.1 KB)
__________________
Steam - GitHub - Tk Libraries - Updater
No private plugin requests.
Teamkiller324 is offline
Send a message via Skype™ to Teamkiller324
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 12-23-2021 , 16:00   Re: [TF2] Gimme (v1.4 22 Dec 2021)
Reply With Quote #7

Quote:
Originally Posted by Teamkiller324 View Post
a slightly modified version with few updated syntax declarations
Thanks Teamkiller324! I made a couple minor changes as well.

Plugin in original post updated to version 1.5

New version has code optimization provided by Teamkiller324.
PC Gamer is offline
The enigma
Member
Join Date: Feb 2016
Old 12-28-2021 , 02:26   Re: [TF2] Gimme (v1.5 23 Dec 2021)
Reply With Quote #8

Hey after using this plugin was wondering if there is an equivalent command that allows you to keep the item after death, like flaminsarges one where it goes sm_givew_ex

I enjoy your plugins keep up the work
The enigma is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 12-28-2021 , 16:40   Re: [TF2] Gimme (v1.5 23 Dec 2021)
Reply With Quote #9

Nice work. Would recommend reworking the custom weapon file syntax (with support for the legacy version, if needed) as that was made a long time ago when I didn't understand how KV files worked.

Also, Github?
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 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.

Last edited by FlaminSarge; 12-28-2021 at 16:44.
FlaminSarge is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 01-01-2022 , 10:50   Re: [TF2] Gimme (v1.5 23 Dec 2021)
Reply With Quote #10

Add a feature that "saves/keeps" the item after death/player respawn?

Mysql?
__________________
ph 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 08:15.


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