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

[TF2] New Give Weapons And Hats Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 12-08-2021 , 10:15   [TF2] New Give Weapons And Hats Plugin
Reply With Quote #1

Hello everyone!

I'm not very good at scripting.
But I really needed a plugin that could give players any weapon from the game.

As I said, I'm not a very good scriptwriter, but I made a working plugin.
Now I post it here so that a normal scriptwriter could remake it and put it in the public domain.

Commands:

HTML Code:
sm_gi <player> <itemindex> - Give Item (Hat or Weapon) to the client
sm_giveitem <player> <itemindex> - Give Item (Hat or Weapon) to the client
sm_gime <itemindex>  - Give Item (Hat or Weapon) to yourself.
Include:

HTML Code:
int WeaponGive_GiveWeapon(int client, int weaponIndex, bool IsAttributes = false, char[] attributes = "\0");
bool WeaponGive_CheckIsWeapon(int index, bool customweapons = false);

Current issues:
Spy Weapons.


Video:

[/spoiler]
Attached Files
File Type: sp Get Plugin or Get Source (weapongive.sp - 202 views - 27.6 KB)
File Type: inc weapongive.inc (980 Bytes, 152 views)
File Type: txt TF2_UTILs.txt (1.4 KB, 150 views)
File Type: txt tf2items.givecustom.txt (5.9 KB, 143 views)
__________________
Sorry for my English.

Last edited by Mr_panica; 12-08-2021 at 11:49.
Mr_panica is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 12-08-2021 , 17:14   Re: [TF2] New Give Weapons And Hats Plugin
Reply With Quote #2

Quote:
Originally Posted by Mr_panica View Post
But I really needed a plugin that could give players any weapon from the game.
Was something wrong with the one posted here? https://forums.alliedmods.net/showthread.php?p=1337899

Last edited by Sreaper; 12-08-2021 at 17:16.
Sreaper is offline
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 12-08-2021 , 22:41   Re: [TF2] New Give Weapons And Hats Plugin
Reply With Quote #3

Quote:
Originally Posted by Sreaper View Post
Was something wrong with the one posted here? https://forums.alliedmods.net/showthread.php?p=1337899
Yes, this is a very old plugin, possibly with memory leaks.
Yes, and through it you can not give any weapon, as far as I know.

And I decided to abandon the TF2Items extension.
__________________
Sorry for my English.

Last edited by Mr_panica; 12-08-2021 at 22:44.
Mr_panica is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 12-16-2021 , 07:25   Re: [TF2] New Give Weapons And Hats Plugin
Reply With Quote #4

I'll take a stab at it...

This is called 'Gimme'. It's a TF2 plugin allows you to equip any class appropriate weapon or item. Emphasis is on class appropriate. In other words, the item must be normally usable by your class in order for you to equip it. For example, if you want to equip a rocketlauncher you must be a soldier. This was done intentionally to prevent weirdness in game with missing models and animations. The item you receive is lost when you die, touch a locker, or change class.

Dependencies:
[TF2] Econ Data by the talented nosoop : Link: https://forums.alliedmods.net/showthread.php?t=315011
TF2Attributes, by either nosoop or FlaminSarge : Link: https://github.com/nosoop/tf2attributes

Link to item index numbers wiki: https://wiki.alliedmods.net/Team_For...nition_Indexes

Commands:
To give yourself an item: !gimme <item index>
To give target player an item: !giveitem <target> <item index>
To get a link to url for item index wiki: !index

Examples:
Give yourself a knife (will only work for Spy): !gimme 4
Give yourself Max's Severed Head: !gimme 162
Give player named Bob the Rocket Launcher (assuming Bob is a soldier): !giveitem bob 18
Give all Bots the B.M.O.C. hat (santa hat): !giveitem @bots 666

I'll post this in the plugins section after testing it for a while on my server. So far everything seems to be working as intended, including Spy weapons.

Note: This is my first attempt to write anything using TF2 Econ Data so feel free to suggest improvements as I am a hobbyist plugin writer trying to get better at coding.

Edit: experimental plugin removed since release version 1.0 was published. Link: https://forums.alliedmods.net/showthread.php?t=335644

Last edited by PC Gamer; 12-20-2021 at 23:29.
PC Gamer is offline
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 01-08-2022 , 02:17   Re: [TF2] New Give Weapons And Hats Plugin
Reply With Quote #5

Quote:
Originally Posted by PC Gamer View Post
I'll take a stab at it...

This is called 'Gimme'. It's a TF2 plugin allows you to equip any class appropriate weapon or item. Emphasis is on class appropriate. In other words, the item must be normally usable by your class in order for you to equip it. For example, if you want to equip a rocketlauncher you must be a soldier. This was done intentionally to prevent weirdness in game with missing models and animations. The item you receive is lost when you die, touch a locker, or change class.

Dependencies:
[TF2] Econ Data by the talented nosoop : Link: https://forums.alliedmods.net/showthread.php?t=315011
TF2Attributes, by either nosoop or FlaminSarge : Link: https://github.com/nosoop/tf2attributes

Link to item index numbers wiki: https://wiki.alliedmods.net/Team_For...nition_Indexes

Commands:
To give yourself an item: !gimme <item index>
To give target player an item: !giveitem <target> <item index>
To get a link to url for item index wiki: !index

Examples:
Give yourself a knife (will only work for Spy): !gimme 4
Give yourself Max's Severed Head: !gimme 162
Give player named Bob the Rocket Launcher (assuming Bob is a soldier): !giveitem bob 18
Give all Bots the B.M.O.C. hat (santa hat): !giveitem @bots 666

I'll post this in the plugins section after testing it for a while on my server. So far everything seems to be working as intended, including Spy weapons.

Note: This is my first attempt to write anything using TF2 Econ Data so feel free to suggest improvements as I am a hobbyist plugin writer trying to get better at coding.

Edit: experimental plugin removed since release version 1.0 was published. Link: https://forums.alliedmods.net/showthread.php?t=335644
Oh, that's great, thank you!
__________________
Sorry for my English.
Mr_panica 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 04:15.


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