AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] New Give Weapons And Hats Plugin (https://forums.alliedmods.net/showthread.php?t=335478)

Mr_panica 12-08-2021 10:15

[TF2] New Give Weapons And Hats Plugin
 
4 Attachment(s)
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]

Sreaper 12-08-2021 17:14

Re: [TF2] New Give Weapons And Hats Plugin
 
Quote:

Originally Posted by Mr_panica (Post 2765335)
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

Mr_panica 12-08-2021 22:41

Re: [TF2] New Give Weapons And Hats Plugin
 
Quote:

Originally Posted by Sreaper (Post 2765359)
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.

PC Gamer 12-16-2021 07:25

Re: [TF2] New Give Weapons And Hats Plugin
 
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

Mr_panica 01-08-2022 02:17

Re: [TF2] New Give Weapons And Hats Plugin
 
Quote:

Originally Posted by PC Gamer (Post 2766208)
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!


All times are GMT -4. The time now is 06:22.

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