Raised This Month: $23 Target: $400
 5% 

TF2Items - Items with custom attributes.


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-10-2010 , 07:15   TF2Items - Items with custom attributes.
#1

This extension allows the attributes, level and quality of items to be modified per player as they are given by the server.

You can join #tf2items @ irc.gamesurge.net if you need help with the extension.

Download & Source:

Download Builds
The tf2items_manager plugin does not come compiled in these builds, you will need to compile it yourself if you want to use it.

Source Code

Instructions:
  1. Copy all files in the release package to your server maintaining the directory structure
  2. Edit tf2items.weapons.txt (In "addons/sourcemod/configs/") according to who you want to get weapons
  3. Type 'sm exts load tf2items'
  4. Join the server
  5. ???
  6. Profit

Notes:
  • The attributes available for tf2items.weapons.txt are here (ignore min/max values).
  • The first key is the number above the attribute you want, and the second is the value.
  • If you load the extension while on the server, it will attempt to hook using a player in the server, otherwise it will only take effect after the next player joins.
  • To reload the tf2items.weapons.txt file you can use 'tf2items_manager_reload'.
  • The included tf2items.weapons.txt file is an example and was made very randomly.

Quality Colours:
Spoiler


Atributions & Thanks:
  • AzuiSleet - Reversed CScriptCreatedItem and released it publicly, along with writing most of the item editing code below.
  • Damizean - Fixed padding for CScriptCreatedItem in Linux. Wrote the SourcePawn Interface and the SourceMod item manager.
  • Voogru - Inspiring the creation of this. Helped with fixing and improving the CScriptCreatedItem class used after the 119 update.
  • Wazz - Wrote "Shit not be void" in #sourcemod and revealed that GiveNamedItem returned CBaseEntity *. Helped with improving the CScriptCreatedItem class.
  • Psychonic - "How did you write the wearable natives asherkin?" "I got all the code from psychonic, then disregarded it and wrote it from scratch."
  • MatthiasVance - Reminded me to comment out '#define INFINITE_PROBLEMS 1'.
  • Drunken_F00l - Inspiring the creation of this.

__________________

Last edited by asherkin; 11-16-2017 at 15:28.
asherkin is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-10-2010 , 07:34   Re: [EXTENSION] TF2Items
#2

Nice job, looks well written as well.
CrimsonGT is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 01-10-2010 , 07:57   Re: [EXTENSION] TF2Items
#3

holy cow
Thrawn2 is offline
cybersquare420
Veteran Member
Join Date: Nov 2008
Old 01-10-2010 , 09:11   Re: [EXTENSION] TF2Items
#4

link in first line of notes is broken
__________________
cybersquare420 is offline
TheSpyHunter
Senior Member
Join Date: Jul 2009
Old 01-10-2010 , 09:23   Re: [EXTENSION] TF2Items
#5

Great work,
Few questions though.

What do these relate to?

PHP Code:
            "count"        "5"
            "attributes"
            
{
                
"132"    "0"
                "134"    "4"
                "3"        "0.17"
                "97"    "0.6"
                "106"    "0.5"
            
}
        } 
and how do we know what o change them to?
__________________
TheSpyHunter is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-10-2010 , 09:28   Re: [EXTENSION] TF2Items
#6

Quote:
Originally Posted by TheSpyHunter View Post
Great work,
Few questions though.

What do these relate to?
and how do we know what o change them to?
Quote:
The attributes available for customweps.txt are Here (at the bottom, ignore min/max values).
The first key is the number above the attribute you want, and the second is the value.
Make sure the attribute count is correct, otherwise the server will most likely crash, I do not advise going over 7-11, YMMV.
Quote:
Originally Posted by cybersquare420 View Post
link in first line of notes is broken
It's a self-signed SSL cert, I've swapped all links for unsecured ones.

Also, a SourcePawn interface is also being worked on, thanks Damizean

Last edited by asherkin; 01-10-2010 at 09:37.
asherkin is offline
Cerise
Senior Member
Join Date: Jun 2009
Location: debug_backtrace()
Old 01-10-2010 , 10:30   Re: [EXTENSION] TF2Items
#7

Nice work mate !

Just a question : If you want to custom ALL weapons for a client, do you need to put a block for every weapons one by one ?
__________________
Cerise is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-10-2010 , 10:33   Re: [EXTENSION] TF2Items
#8

At the moment, yes. In the next version I plan to add wildcarding and admin flag checks, bear in mind though that you can only currently edit the attributes of the base weapons, not the unlockables. The quality and level are fine however.
Edit: Turns out you can edit the unlockable's attributes, bear in mind that it completely overwrites existing ones though.
__________________

Last edited by asherkin; 01-10-2010 at 10:52.
asherkin is offline
Old 01-10-2010, 10:44
Cerise
This message has been deleted by Cerise. Reason: Double Post
Cerise
Senior Member
Join Date: Jun 2009
Location: debug_backtrace()
Old 01-10-2010 , 11:11   Re: [EXTENSION] TF2Items
#9

Concerning the attribute "134" ( Attach Particle effect ),
where should i find which number corresponds to which effect ?
__________________
Cerise is offline
TheSpyHunter
Senior Member
Join Date: Jul 2009
Old 01-10-2010 , 11:14   Re: [EXTENSION] TF2Items
#10

I copied everything to my server, changed the default id to mine and added another admin (lets call him admin(2)), leaving everything else as default.

I rebooted the server then ran the command, waited for admin(2) to join.

I killed them and no weapon showed, they killed me and no weapon showed.

Running mm1.8 sm 1.3, windows.
__________________
TheSpyHunter is offline
Closed Thread



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


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