AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2Items] Item Designer - Advanced Give Item (https://forums.alliedmods.net/showthread.php?t=143586)

DarthNinja 11-21-2010 16:24

[TF2Items] Item Designer - Advanced Give Item
 
2 Attachment(s)
[TF2Items] Item Designer
AKA: Advanced Give Item

Version 1.0.2



Description:
This plugin is a hybrid of TF2Items' manager plugin and Give Weapon in that it allows you to give custom items without editing/uploading/reloading a config file.

I wrote this plugin to make testing attribute settings easier and am releasing it in the hopes that others may find it useful.

Warning/Note:
This plugin assumes you know what you are doing. If you feed the command bad data the plugin will try to use it and will crash the server!
Make sure your command string is valid before running it!

Requires asherkin's TF2Items extension.

Commands:
sm_giveitem - Gives an item
sm_gi - Same as above

Command Usage:
Command Structure:
sm_gi <client> <item index> <slot> <level> <quality> <preserve attribs 1/0> <hat 1/0> <tf_weapon_classname> <"attributes">
  1. <Client> = target player
  2. <Item index> = item index from items_game.txt
  3. <Slot> = Weapon's slot, primary = 1, secondary = 2, etc. Use -1 for hats.
  4. <Level> = New item level (0-100). -1 for no change.
  5. <Quality> = New item quality. -1 for no change.
  6. <Preserve Attributes> = Keep existing attributes 1/0 (use 0 as I haven't tested 1)
  7. <Hat> = 1/0 - Controls the give method, see below.
  8. <tf_weapon_classname> = "item_class" from items_game.txt Example: tf_weapon_knife or tf_weapon_rocketlauncher
  9. <Attributes> = Same format as tf2items_manager's config file. Eg: "129 ; 10"
Give methods:
  • Mode 0 will give and equip a weapon immediately and must be used for weapons only.
  • Mode 1 will edit the item as it is equipped and must be used for hats only.
    You must have the hat equipped for the command to do anything.
  • Using weapons with mode 1 or hats with mode 0 will cause crashes!
Examples:
  • sm_gi @me 298 1 100 -1 0 0 tf_weapon_minigun "129 ; 5"
    Would give you a level 100 Iron Curtain that heals you 5 hp a second
  • sm_gi @me 298 1 100 -1 0 0 tf_weapon_minigun "129 ; 5" "16 ; 2" "37 ; 3"
    Would give you a level 100 Iron Curtain that heals you 5 hp a second, heals you for 2 hp per hit, and has 3 times as much ammo.
  • sm_gi @me 18 1 50 8 0 0 tf_weapon_rocketlauncher "2 ; 100.0" "4 ; 91.0" "6 ; 0.25" "110 ; 500.0" "26 ; 250.0" "31 ; 10.0" "107 ; 3.0" "97 ; 0.4" "134 ; 4.0"
    Would give you a level 50 valve rocket launcher with crazy stats.
  • sm_gi @me 146 -1 69 5 0 1 -1 "134 ; 13"
    Would give me an Unusual level 69 demo pimp hat with valve fire. Assuming I'm a demo with a pimp hat.
Cvars:
sm_giveitem_version - Plugin Version
sm_giveitem_textspew - 1/0 Sets whether to print debugging text (default = on).

Install Instructions:
  1. Install TF2Items.
  2. Place GiveItem.smx into your addons/sourcemod/plugins/ folder.
Notes:
I wrote this mostly over a period of 2 sleepless nights, so if you notice anything goofy in the code, that's why.
Default admin flag is ROOT.
If you or someone else inadvertently crashes your server by giving this plugin bad data, do not complain to me!
Use [TF2] Set Ammo to change ammo values if so desired.

ToDo:
  • Video
  • Moar examples
Version History:
  • V1.0.0
    • Initial Release
  • V1.0.1
    • Fixed Errors when using rcon
  • V1.0.2
    • Fixed another error
43|58

This uses the tf2items extension, and will not compile on the forum.
Use the attached smx or compile it yourself.

DarthNinja 11-21-2010 16:29

Re: [TF2Items] Advanced Give Item
 
~Reserved

DarthNinja 11-21-2010 16:30

Re: [TF2Items] Advanced Give Item
 
~Also Reserved

FlaminSarge 11-21-2010 17:12

Re: [TF2Items] Advanced Give Item
 
/gi @all 0 1 127 10 1 0 tf_weapon_knife "134 ; 19"
Crash everything!

Skyrider 11-23-2010 07:30

Re: [TF2Items] Advanced Give Item
 
Is there anyway to give yourself a hat rather than giving your hat that you own an effect? So far it doesn't work and I can only get myself weapons. I'm not too much familiar with giving items by the way.

DarthNinja 11-23-2010 09:03

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by FF|Skyrider (Post 1355026)
Is there anyway to give yourself a hat rather than giving your hat that you own an effect? So far it doesn't work and I can only get myself weapons. I'm not too much familiar with giving items by the way.

You can "give" a hat using TF2items, however nobody but the equipped player will see it. For this reason I have not implemented that ability in the plugin.

Your choices are:
Give a weapon (right away).
Change a hat the next time you equip your loadout. (The plugin regenerates your loadout right away, so you see the changes immediately.)
You MUST have the hat equipped to your current class or the command will do nothing.

As per my examples above:
Quote:

sm_gi @me 146 -1 69 5 0 1 -1 "134 ; 13"
Would give me an Unusual level 69 demo pimp hat with valve fire. Assuming I'm a demo with a pimp hat.
I must be a demo, and I must have the Pimp hat equipped.

Regis 11-23-2010 11:09

Re: [TF2Items] Advanced Give Item
 
Fantastic, much easier to test weapons on the go, now we just need a way to see the weapons when they spawn (where's that workaround I keep hearing about :|).

DarthNinja 11-23-2010 12:29

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by Regis (Post 1355142)
Fantastic, much easier to test weapons on the go, now we just need a way to see the weapons when they spawn (where's that workaround I keep hearing about :|).

Glad you like it, testing attributes before committing them to the config is really what this is intended for.
I think you might be able to use SetEntityModel as a workaround, never tried it though.

eraserhead 11-29-2010 13:03

Re: [TF2Items] Advanced Give Item
 
Great plugin DarthNinja. Only i'm a little concerned about giving people Valve hat related effects. The whole reason why Valve blocked the equipment manager and TF2Items functionality was because people could freely equip Valve items. So we have to watch out.

DarthNinja 11-29-2010 13:31

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by eraserhead (Post 1359656)
Great plugin DarthNinja. Only i'm a little concerned about giving people Valve hat related effects. The whole reason why Valve blocked the equipment manager and TF2Items functionality was because people could freely equip Valve items. So we have to watch out.

This doesn't do anything that can't be done with the tf2items base.

FaTony 12-06-2010 04:51

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by eraserhead (Post 1359656)
Valve blocked the equipment manager and TF2Items functionality was because people could freely equip Valve items. So we have to watch out.

So they'll have to block it again and again, but we'll be cracking their shitty milking system.

danmon 12-13-2010 17:34

Re: [TF2Items] Advanced Give Item
 
Quote:

L 12/13/2010 - 17:28:22: [SM] Native "PrintToChat" reported: Client index 0 is invalid
L 12/13/2010 - 17:28:22: [SM] Displaying call stack trace for plugin "GiveItem.smx":
L 12/13/2010 - 17:28:22: [SM] [0] Line 202, C:\sourcemod compile 1.3.5 hg3053\scripting\GiveItem.sp::GiveItem()

is this an issue with sourcemod version or something?

DarthNinja 12-13-2010 17:50

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by danmon (Post 1370623)
is this an issue with sourcemod version or something?

Issue with you using rcon to issue the command.
-I'll fix it, one moment.

DarthNinja 12-13-2010 18:57

Re: [TF2Items] Advanced Give Item
 
Paste your command string

Skyrider 12-24-2010 21:07

Re: [TF2Items] Advanced Give Item
 
Using:
Quote:

sm_gi @me 18 1 50 8 0 0 tf_weapon_rocketlauncher "2 ; 100.0" "4 ; 91.0" "6 ; 0.25" "110 ; 500.0" "26 ; 250.0" "31 ; 10.0" "107 ; 3.0" "97 ; 0.4" "134 ; 4.0"
Crashes the entire server.

DarthNinja 12-24-2010 22:18

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by FF|Skyrider (Post 1378386)
Using:

Crashes the entire server.

Works just dandy for me!

TheJoker 12-26-2010 04:43

Re: [TF2Items] Advanced Give Item
 
« sm_gi @me 146 -1 69 5 0 1 -1 "134 ; 13" »

It's don't work, I have the "Ellis' Cap" for Demoman. And, I enter this command, and I don't see your pimp hat.

DarthNinja 12-26-2010 13:23

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by TheJoker (Post 1379154)
« sm_gi @me 146 -1 69 5 0 1 -1 "134 ; 13" »

It's don't work, I have the "Ellis' Cap" for Demoman. And, I enter this command, and I don't see your pimp hat.

Quote:

Originally Posted by DarthNinja (Post 1353985)
Give methods:
  • Mode 0 will give and equip a weapon immediately and must be used for weapons only.
  • Mode 1 will edit the item as it is equipped and must be used for hats only.
    You must have the hat equipped for the command to do anything.
  • Using weapons with mode 1 or hats with mode 0 will cause crashes!


JoBarfCreepy 06-07-2011 12:34

Re: [TF2Items] Advanced Give Item
 
Let me get this right... When you give clients items, you can keep the for online play also? I mean, store them in your backpack? I never play online, so I don't really care wether it works online or not.

FunkyLoveCow 06-07-2011 12:45

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by JoBarfCreepy (Post 1483044)
Let me get this right... When you give clients items, you can keep the for online play also? I mean, store them in your backpack? I never play online, so I don't really care wether it works online or not.

You never play TF2 online?

DarthNinja 06-08-2011 01:19

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by JoBarfCreepy (Post 1483044)
Let me get this right... When you give clients items, you can keep the for online play also? I mean, store them in your backpack? I never play online, so I don't really care wether it works online or not.

I'm fairly sure you have no idea what this is for.

JoBarfCreepy 06-10-2011 13:45

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by FunkyLoveCow (Post 1483055)
You never play TF2 online?

No way, I never play games online anymore, thats what we have bots for. They don't complain, nor do they troll you, and thats good enough for me.

Quote:

Originally Posted by DarthNinja (Post 1483413)
I'm fairly sure you have no idea what this is for.

Guess I just exposed myself right there :/

*EDIT*
Okay, I know how it works, I just have a few problems with the attributes, but thats all. Thanks for the plugin. *Infinite grenade spam*

DarthNinja 06-11-2011 02:43

Re: [TF2Items] Advanced Give Item
 
Well this is mostly a design tool to quickly experiment with weapon settings.
To apply them long-term use the TF2items plugin, to "give" them out, just create a custom weapon with FlaminSarge's plugin

JoBarfCreepy 06-12-2011 14:17

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by DarthNinja (Post 1485549)
Well this is mostly a design tool to quickly experiment with weapon settings.
To apply them long-term use the TF2items plugin, to "give" them out, just create a custom weapon with FlaminSarge's plugin

I understand that now... I just need to know how to find ze attributes, and then I will be the new gunsmith :).

DarthNinja 06-12-2011 14:27

Re: [TF2Items] Advanced Give Item
 
You can find them in scripts/items/items_game.txt on your server.

JoBarfCreepy 06-12-2011 14:54

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by DarthNinja (Post 1486557)
You can find them in scripts/items/items_game.txt on your server.

Unfortunately, I host locally as I my Dedicated Server plan failz'ed, and I see nothing in the original folder. I've been looking for it, I even used the search function :/
Any possability that I can have a copy of yours?
My friend once helped me setting up the game_items.txt, but it was lost again because of an update.

DarthNinja 06-12-2011 14:56

Re: [TF2Items] Advanced Give Item
 
This should be current as of this posting:
http://dl.dropbox.com/u/24583970/sm/items_game.txt

JoBarfCreepy 06-12-2011 15:05

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by DarthNinja (Post 1486583)
This should be current as of this posting:
http://dl.dropbox.com/u/24583970/sm/items_game.txt

Thanks!

*Addiotional info*
I don't understand, sorry. I need the numbers of the attributes, not the names. Like, 6 is firerate, 3 is magazine multiplier. That sort of numbers.

Muscle Brazil 06-12-2011 22:42

Re: [TF2Items] Advanced Give Item
 
I tested the pluguin more every time I have to keep giving the command to have the item. Another thing I like devira boot to have a simple rocket launcher only with brightness comunity rocket. thanks

DarthNinja 06-12-2011 23:38

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by JoBarfCreepy (Post 1486601)
I don't understand, sorry. I need the numbers of the attributes, not the names. Like, 6 is firerate, 3 is magazine multiplier. That sort of numbers.

Everything you need is in that file.

Quote:

Originally Posted by Muscle Brazil (Post 1486900)
I tested the pluguin more every time I have to keep giving the command to have the item. Another thing I like devira boot to have a simple rocket launcher only with brightness comunity rocket. thanks

What?

Muscle Brazil 06-13-2011 00:06

Re: [TF2Items] Advanced Give Item - Item Designer
 
I was wondering how DN leave a rocket launcher only with simple brightness comunity valve type rocket. that does not change anything in brightness only with the weapon

JoBarfCreepy 06-13-2011 10:45

Re: [TF2Items] Advanced Give Item
 
Quote:

Originally Posted by DarthNinja (Post 1486918)
Everything you need is in that file.

Damn... Could you explain zis to me in a PM or something?
You don't need to, though. Just asking.

DarthNinja 06-13-2011 11:49

Re: [TF2Items] Advanced Give Item - Item Designer
 
There's info in the tf2items extension thread.
If you need more help, join, ask, and idle in the irc channel linked in that thread's OP.
This plugin is designed for people who already know how to work with attributes, so it's assumed that you covered this when you set up the tf2items ext.

Muscle Brazil 06-13-2011 12:02

Re: [TF2Items] Advanced Give Item - Item Designer
 
I'm trying difficulties. whenever I have to die from the command sm_gi?

DN can you answer my pm xD
Ouvir

DarthNinja 06-13-2011 23:37

Re: [TF2Items] Advanced Give Item - Item Designer
 
Quote:

Originally Posted by Muscle Brazil (Post 1487323)
I'm trying difficulties. whenever I have to die from the command sm_gi?

DN can you answer my pm xD
Ouvir

I won't do support over Steam.
You do not have to die or do anything other then run the command.

I think what you're trying to do is create a rocket launcher with community sparkle.
Here's how:

Take a look at items_game.txt while you read this so you'll learn how to do it yourself.

Code:

You want to give yourself the weapon, so you start with:
sm_gi @me

You want it to be a rocket launcher, so what is the item number for it (items_game.txt)?  18!
sm_gi @me 18

This is a primary weapon, so slot 1.
sm_gi @me 18 1

What level do we want it to show up as (0 to 100)?  75.
sm_gi @me 18 1 75

What quality (controls item title color and name prefix - vintage, community, valve, etc)?  Community is #7 so:
sm_gi @me 18 1 75 7
(Note: this has nothing to do with the sparkle).

Preserve attributes? (Use 0 here).
sm_gi @me 18 1 75 7 0

Is it a hat? No.
sm_gi @me 18 1 75 7 0 0

What is the TF_WEAPON classname? TF_WEAPON_ROCKETLAUNCHER.
sm_gi @me 18 1 75 7 0 0 TF_WEAPON_ROCKETLAUNCHER

Now you add your attributes to make the custom weapon. Each attribute is defined like this: "Attribute ; Value".
So we want community sparkle:
"attach particle effect" is attribute #134. Particle system "community_sparkle" is #4.  So our formatted attribute would be "134 ; 4".

Add that to the command string, and we have:
sm_gi @me 18 1 75 7 0 0 TF_WEAPON_ROCKETLAUNCHER "134 ; 4"
That should give you a level 75 Community Rocket Launcher with Community Sparkle.


Muscle Brazil 06-16-2011 11:27

Re: [TF2Items] Advanced Give Item - Item Designer
 
is there any way to leave this command sm_gi fixed because every time he got to the hill of the command in the console again. I doubt he leaves and is fixed?
:grrr:

DarthNinja 06-16-2011 16:38

Re: [TF2Items] Advanced Give Item - Item Designer
 
Use the plugin included with the tf2items extension then?

Muscle Brazil 06-16-2011 16:48

Re: [TF2Items] Advanced Give Item - Item Designer
 
I use more expensive does not work. this only works with your plugin and always giving the command sm_gi.

JoBarfCreepy 06-17-2011 08:46

Re: [TF2Items] Advanced Give Item - Item Designer
 
NOOOO! How could I be so ignorant!?
Thanks! I got it working now :D
Now I am ze new gunsmith :3 *Subscribing thread*


JoBarfCreepy requesting permission to start a new thread, where people can share their customized guns and descuss their effects, and maybe request more guns.
Please?

steryman 08-01-2011 01:57

Re: [TF2Items] Advanced Give Item - Item Designer
 
Hello guys I have a problem... for about half of a month it stopped to work properly... if I'm using the command it crashes the server. Any attributes I'm using, even those wich were working, now it simply crashes the server... Can someone help me fix this please?


All times are GMT -4. The time now is 21:26.

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