[TF2Items] Give Weapon (v3.14159, 11/29/2013)
69 Attachment(s)
Potential replacement for this plugin: https://forums.alliedmods.net/showthread.php?t=335644
This plugin allows you to do /giveweapon (or /givew) <target> <itemindex> to give that player that weapon. Update 11/29/2013 - The Pi update, round four (3.14159). Fixes TF2II interaction. A few other bugfixes, plus some new features with models/etc (check out the changelog). The .sp and .smx files changed. CVARS
Installation Quote:
If you are compiling it yourself, you need the tf2items.inc file from the TF2Items extension's download package. Update that if you get any compile errors. Also get the tf2itemsinfo.inc file from TF2ItemsInfo since that's useful for auto-updating the weaponlist. SourceMod 1.5+ required (needs GetPlayerResourceEntity() from 1.5). Changelog: MM/DD/YYYY (vVERSION) Code:
11/29/2013(v3.14159 ) Known Bugs *Ammo is set correctly when the weapon is given, but when players pick up ammo boxes, the ammo sets to what the class normally would get from the pack. I have the fix, but I want to test more on it. Credits California Bear- for a server on which to test this; that server is gone now :C canceled... asherkin- for the TF2Items extension and the code to give weapons to clients using that extension (plus NULL bug stuff) naris- for the original stocks to set ammo amounts DarthNinja- I looked at his code for Have Some Piss and Have Some Ballz to set ammo correctly for some weapons (now all weapons) "Q" and MrSaturn21- for another server on which to test this. Working perfectly at the moment :D jameless- for helping me test a lot, and helping find which items have the NULL bug for TF2Items_GiveNamedItem Sorrowfire- for putting in Polycount Weapons Mecha the Slag- Khopesh Climber! ummja/Noob Lord - more help with testing _1Swatty - LibraryExists stuff for Visible Weapons compatibility All the other testers- for testing. and bug-reporting. and possibly for complaining. Item Indexes to Use http://wiki.alliedmods.net/Team_Fort...nition_Indexes Or use this, though I won't guarantee that it's up to date.
Spoiler
Quote:
The file tf2items.givecustom.txt goes in addons/sourcemod/configs/ It's used to create your own custom weapons. PHP Code:
In the next bracket down is the first custom weapon index you want to create, e.g. 9999. Under that you specify classname, index, slot (0 is primary, goes up to 5), quality, level, attributes, ammo, and model. Attributes are formatted like so: "attribute1 index ; attribute2 value ; attribute2 index ; attribute2 value" etc. You can get these values from items_game.txt After changing the config, do tf2items_giveweapon_reload in console/rcon. Don't make a custom weapon use any of the current weapon indices. It probably won't work. PHP Code:
So you have your custom model, and in the custom cfg, under its custom index, you have that model (or viewmodel) path, e.g. Code:
"model" "models/custom/weapons/rebelscurse/c_wrench.mdl" Code:
models/custom/weapons/rebelscurse/c_wrench.mdl So now these will all download for clients, and your custom weapon models will work. You can also use "model_pv", "model_hv", and "model_rv" for Pyrovision, Halloweenvision, and Romevision, respectively. BUT IF the .dep file does not exist (as in, you do not make one), but the model DOES exist (e.g. you decide to use a currently-existing weapon model in place of the one that's on the weapon), it will precache that (already-existing) model. It won't add it to the downloads table for clients to download, though. Also, if sv_downloadurl is not blank on your server, it means you have a redirect! (If your provider is gameservers.com, they should automatically mirror any files you put on the server to the redirect). If not, you have to put the models on the Redirect/FastDownload server too (note to people that already know this: think of those that don't know). If you are unaware how to, ask somebody for help! No doubt somebody around you will know how. Custom weapon models are in the 2nd post. This includes the Khopesh Climber and the Rebel's Curse. Alright, I'm done talking for now. |
Re: [TF2Items] Give Weapon (v2.7, 02/24/2011)
3 Attachment(s)
Custom Weapon Models:
Alright, so, dedicated post for all weapon models that I hardcoded into the plugin (this includes Randomizer). Right now, that's: the Khopesh Climber the Rebel's Curse Each has three folders inside, materials, models, and fastdl Place the materials and models folder in your server's tf folder, then place the contents of the "fastdl" folder (another materials and models folder are those contents) on your sv_downloadurl server's or fastdownload server's tf folder (if you DON'T have a fastdownload server, ignore the fastdl folder). Credits: Khopesh Climber - Originally "The Scythe of Slaughter" skin by ez_jamin. Converted to a custom model by Mecha the Slag. Rebel's Curse - Originally the Golden Wrench by Valve, I fiddled with it to its current state. Rebel's Curse model updated 04/07/2012. Use the 'v2' file. Previous 2nd/3rd posts:
Spoiler
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
If you can run TF2 on 98, sure. Go ahead.
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Is it by chance posible for you to create a version where users may select a weapon to force upon themselves? Using chat commands (auto hidden to keep chat clean) or console commands. I personal would like the option on my own server. It would be only fair to restrict users from forcing on other people [only admin should be able to force onto others].
Maybe just add this to the existing plugin with a CVAR to enable users to force upon themselves. |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
suggestion: add some natives for other developers to use this.
pretty please :] |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Natives.... How do i shot natives...
loljk I'll try. In the meantime, try just using the TF2Items Extension natives, that's all this does, use those natives. Or, copy the code a bit. You'll need the trie for all the weapons if you want all the weapon attributes (I'm presently converting that to a keyvalues, hopefully), plus PrepareItemHandle and Command_Weapon. That should work for any plugin that uses TF2Items. Also thrawn I have a weapon replace plugin that can replace the sandvich with the shotgun, etc. But a person requested it from me in exchange for a hat, and asked me to keep it private for a while. Sit tight, I'll release it sometime soon or add it to tNoUnlocksPls :P |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Lol woops I read wrong. It WOULD be awesome to make a sandvich have the attributes of a shotgun, though :P
Also, I am going to add client commands for the few custom weapons I have in there, such as Ludmila, the Texas Ten Shot, and the Army of One. Useable once every spawn only (otherwise the Army of One would be... VERY overpowered). |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
Or is it possible for one to compile one for their own private use? (What would I need to remove for the commands to be public? I'm not worried about things becoming over powered, unfair advantage or anything of the sort). |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Sorry about the cross post, but I suppose this is as much about your plugin as it is about the extension. I posed this initially here: http://forums.alliedmods.net/showpos...&postcount=541
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Oinkie, the tf2items.weapons.txt does NOT touch Give Weapon. All the weapons in Give Weapon are hardcoded to the plugin itself. What that config txt file thing does is, for tf2items_manager (a separate plugin), it makes a list of players' weapons that it should modify. So if you put in code for changing somebody's wrench to make people golden, then that person, if they use the wrench, will turn people golden.
Reloading the items list basically reloads that file, meaning it re-applies whatever is in that file to the game. Doesn't interact with giveweapon at all. Like I said, I'm planning to add some type of keyvalues support for custom weapons. Meaning it will have its own config file. Also, "Reloading items list" is the confirmation. Again, tf2items_manager and tf2items_giveweapon are two separate plugins. manager uses that config file to determine what to change on spawn, while giveweapon gives weapons with specific attributes (which are in the plugin not in a config) @TheKisho I'll add /giveme commands that are toggleable by a cvar. |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
Code:
sm_give @me 9018 Then I thought that it was related to just the valve weapons so I tried giving myself the direct hit or black box as a soldier. Still keeps me at the regular rocket launcher, even though it announces I got the new weapon. What am I doing wrong? :( Thanks for the clarification about tf2items.weapons.txt though. I had been trying forever to get that to be populated. :) |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
When you do sm_give @me 9018, you should have the valve rocket launcher, which looks almost no different from the regular rocket launcher. Do NOT touch a locker after this or it will be replaced by your normal loadout. Try firing a few rockets, see the difference.
Also, HINT: 8018 and 7018. Heh. |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Bump, I updated the OP with all the indexes in there so far. I am adding a way to add your own custom item indexes AS LONG AS YOU DO NOT USE THE SAME NUMBER AS THESE ONES. If you try, it'll be overwritten with the data from these, so your own custom ones won't work.
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Hey i love the plugin works ok still annoying sm_giveweapon_ex or sm_give_ex because it don't work all the time and takes while for the weapon to appear but other then that it works great only thing i was wondering is it possible to make it where i give someone a weapon they keep it for ever then have a command to remove it from the person or maybe make it like this sm_givegoldenwrench to a player and they can only use it on engineer and they keep it for ever and make a screen pop up saying Equip Golden Wrench, UnEquip golden Wrench, Equip Golden Wrench Forever, if so i would love to use it on my server to give out for events and stuff :)
|
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
lol iSins, glad you posted the suggestion here instead of PM's where I forget. As I think I explained before, the _ex commands basically give the player the weapon when they next have a full loadout change. E.g., spawn or if they touch a locker WHILE THEY HAVE NON-NORMAL WEAPONS. If you touch a locker when you have your normal weapons, it won't regenerate your weapons, and so it won't give whatever you gave with give_ex.
Shortened explanation: give_ex is for applying on spawn or loadout change, doesn't give immediately. I am adding permanent weapon ones, just wait. In the meantime you can do: bind f "sm_give @me 169; sm_give_ex @me 169" and press it every time you don't have the golden wrench. That way every time you respawn you WILL have the wrench without having to press the command on respawn. That's how give_ex works. I did give_ex 169 as an engy then switched to scout, I had the golden wrench :D |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Think i already know the answer to this. but i figure il ask. Is there any way at all to make the weapons actually display? or has valve broken that far beyond recovery?
Im also making a plugin that works with yours. it populates the server with 1 valve weapon per 12 people. and the weapon is transferred to whom ever killed the original owner,creating a sort of battle for who can control the valve weapons. but. since they dont showup visually. it makes it rather difficult to spot who has them.so far ive gotten some amazing words of appreciation from my server fans :p inspite of the fact that my coding ability sucks. Still. the main question remains " When do we get to see them?" so far ive been saying "Never,because of valve" "note to self....editing a post while having noscript enabled is evil" |
Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
Quote:
http://forums.alliedmods.net/showthread.php?t=106293 |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Updated to allow you to have a configs/tf2items.givecustom.txt file. Use the example on the main post attachments to make your own. First number is what index you want to define it as (e.g. 9001), classname is tf_weapon_*, meaning whatever its base classname is. index is the actual index of the weapon (e.g. blackbox is 228 ). quality 6 is unlockable, 5 is unusual, etc. Look up the tf2items extension thread for more quality setting info. Level is level, keep it under 127. Finally, Ammo is how much ammo you get when you /give it.
slot 0 is primary, 1 secondary, 2 melee, 3 is 4th slot, 4 is 5th slot, and 5 is for the engineer's building box. attribs line is just a line of attributes separated by " ; ". So you would just have the attrib index first, then the attrib value, and then the next attrib index, then the next attrib value. Don't put too many on there, the character limit for that is... 256? Example: "attribs" "134 ; 19 ; 2 ; 999.0 ; 150 ; 1" would set attribute 134 to 19, 2 to 999, and 150 to 1 (heart effects, +99800% damage done, and turns to gold. Also, disabled give_ex until it works right. |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Quote:
But yeah, i like your progress with this Sarge, keep up the amazing work. Ps: We will see who gets to the poker night items first after its out :P But if you keep updating at this rate, i might not even be able to figure out the scripting anymore xP |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Turn to gold, 150 ; 1, only works on all engineer melee weapons. *clarification*
|
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Awesome update FlamingSarge. Asherkins is nice but this is a much easier one to use.
|
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
This one is asherkins. Major derp there. It's from his original giveitem plugin, with a couple updates.
Also, slight peeve, but its "FlaminSarge" not "FlamingSarge"... |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Bug report:
- Using teleports resets the weapon list. |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Quote:
It really shouldn't do that though. The weapon list doesn't touch the teleport event nor any other events... In fact, the entire plugin doesn't touch the teleport event... |
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Ohh... there must be some kind of respawn when a player teleports... I'll see what I can do about it. In the meantime, give again when you teleport. Sorry :C
|
Re: [TF2Items] Give Weapon (v1.4.1.1.0, 11/6/2010)
Quote:
Have you got another plugin or extension which influences teleportation in any way? (i.e. something which could be calling CTFPlayer::Regenerate(void) ?) |
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Something is definitely wrong with another plugin of yours, then, Skyrider.
In other news: 11/10/2010 update, give_ex is converted to the permanent weapon command. also, sm_resetex to reset the permanent weapons for a client. |
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Some weapons just show up as invisible for other (such as the golden wrench).
Any way to fix that? :) Also, great and fun plugin. |
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
https://secure.voogru.com/petition/
Read the top couple of lines, they have the most pertinent info. Mecha the Slag is working on visible weapons, btw. |
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
I've also heard that a quick coat of jarate does the trick. So go rub some piss on yourself xD
|
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Quote:
|
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
If the spy thing works, try addcond with the spy disguise smoke and all that jazz, or force a disguise on a non-spy class, then instantly take it off.
|
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Quote:
And how do you force a disguise? :? |
Re: [TF2Items] Give Weapon (v1.4.1.2.0, 11/10/2010)
Sourcemod has an addcond native which lets you use addcond without sv_cheats. its TF2_AddCondition(client, condition, duration), and was added in sourcemod 1.3.4.
You can't just type it in console to do it, its something developers put in plugins. I have an addcond plugin that does it. |
All times are GMT -4. The time now is 01:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.