Raised This Month: $7 Target: $400
 1% 

[TF2Items] Give Weapon (v3.14159, 11/29/2013)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
FlaminSarge
Veteran Member
Join Date: Jul 2010
Plugin ID:
2042
Plugin Version:
3.14159
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    533 
    Plugin Description:
    Old 10-30-2010 , 21:58   [TF2Items] Give Weapon (v3.14159, 11/29/2013)
    Reply With Quote #1

    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
    • tf2items_giveweapon_version (3.14159 ): Version number. Do not change. Do NOT place this in your configs.
    • tf2items_giveweapon_notify (default is 2): 1- Use ShowActivity2 when givew; 2- Use ShowActivity2 when givew and _ex; 0- Hide all give activity
    • tf2items_valveweapons (don't set in any config if you want valve weapons on. The default value is what allows them): If non-default, if anybody tries to give any weapon index whose absolute value is 7018 or between 8000 and 9999, it will not let them. Beware, this also means w/ custom weapons in the config.
    • tf2items_customweapons_lowadmins (default is 1): If 0, disables sm_ludmila, sm_gloves, and sm_spycrab (and their longer commands).
    • tf2items_allow_gimme (default is 1): 1 to allow the command sm_gimme, 0 to block it.
    • tf2items_use_tf2ii (default is 1): Only matters if TF2ItemsInfo is loaded (and plugin was compiled with TF2II include). 1 to grab weapon data from TF2ItemsInfo (therefore automatically updating weapons), 0 to not.
    COMMANDS (and a quick refresher on admin overrides)
    • sm_giveweapon or sm_givew <target> <itemindex>(default "cheats" flag) - Gives a weapon. Works with wearable weapons. Both respond to the admin override "sm_giveweapon".
    • sm_giveweapon_ex or sm_givew_ex <target> <itemindex> [mode] (default "cheats" flag) - Gives on inventory application (spawn or locker touch- maybe not locker touch if you don't change loadout). Permanent until map end, disconnect, or sm_resetex. If you include mode as 1, it gives it immediately and sets to permanent. Default mode is 0 if you don't specify. Also works with wearable weps. Both respond to the admin override "sm_giveweapon_ex".
    • sm_ludmila (default "generic" flag) - gives ludmila to yourself (index 2041)
    • sm_glovesofrunning or sm_gloves (default "generic" flag) - gives the Gloves of Running Urgently to yourself- now that it's officially in, I might remove this (index 239)
    • sm_spycrabpda or sm_spycrab - (default "generic" flag) - gives a special Spycrabbing PDA to yourself (index 9027)
    • tf2items_giveweapon_reload - (default "cheats" flag) - reloads the custom item list in your configs/tf2items.givecustom.txt
    • sm_resetex <target> ["slot"/"index"] [slot/index numbers] - (default "generic" flag) - remove the permanent weapons on a player (so that next time they spawn or touch a locker, they don't get those weapons). To reset a specific slot or index, you do sm_resetex <target> slot 1 3 4 2. You put in the word "slot" or "index" as the 2nd argument, and any slots/indices you want to reset after (up to 32 in one command).
    • sm_addwr (sm_addwearable) <index> - adds a wearable weapon onto you without stripping slot 2 (since all the 4 wearable weps are slot 2). Both commands respect the "sm_addwearable" admin override.
    • sm_gimme <index> - Same as sm_givew @me, but restricted to yourself. Default admin flag is Kick.

    Installation
    Quote:
    Originally Posted by FunkyLoveCow View Post
    If updating TF2Items
    A.) Shut down your game server
    B.) Download the TF2Items extension from here. Extract the relevant OS's file to your desktop.
    C.) Browse the extracted directory until you get to the level where there are 5 subdirectories (config, extensions, gamedata, plugins, scripting)
    D.) In another window, open up a link to your game server - do this either via FTP or SCP or whatever you normally use to move files from your desktop to your game server.
    E.) Browse to the tf/addons/sourcemod directory on your game server.
    F.) Copy all directories that you see in Step C to the location you are at in Step E (overwriting them). TF2Items is now installed.

    Start here if you've already updated TF2Items

    1.) Click this link and download the file "tf2items.randomizer.txt" from here. This is your gamedata file. Save this file to your desktop.
    2.) Move this file, named 'tf2items.randomizer.txt' to the 'gamedata' folder you see in Step E above (on your server).
    3.) In THIS plugin thread's first post, download the file tf2items_giveweapon.smx. Save it to your desktop. Do NOT download the file named tf2items_giveweapon.sp, unless you know exactly what you're doing.
    4.) Copy this file, named 'tf2items_giveweapon.smx' to the 'plugins' folder you see in Step E (on your server).
    Optional but important) Install TF2ItemsInfo and the weapon list will automatically update.
    5.) Turn your game server back on, if it's not on.
    If you've got crashing, try installing https://github.com/FlaminSarge/tf_sa...elfix/releases, then restarting your server.

    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).

    If you want visible weapons, and you have SDKHooks and Attachables installed, https://forums.alliedmods.net/showthread.php?p=1374048


    Changelog: MM/DD/YYYY (vVERSION)
    Code:
    11/29/2013(v3.14159 )
    *Added support for "model_pv", "model_hv", and "model_rv" in the custom config which set the models in Pyrovision, Halloweenvision, and Romevision respectively (yes, Halloweenvision takes over when you've got Halloween/Full Moon mode on).
    *Moved Rebel's Curse dissolve to the ragdoll dissolve weapon attribute.
    *Fixed Katana adding eye particles/heads (I think I left in the old eye particles, not the weird new green ones).
    *Updated sm_givew and sm_givew_ex to respect the admin accesses for sm_giveweapon and sm_giveweapon_ex, respectively. Same goes for sm_addwr with sm_addwearable.
    *Added 1.5x overheal limiter every time sm_gimme is used.
    *Fixed interaction with TF2ItemsInfo (so botkillers/etc should work again).
    *Fixed TF2II-based shotgun and sapper issues.
    *Did NOT update the internal item list for the latest weapon changes (Amputator, etc). I'd highly suggest just getting TF2ItemsInfo to fix this, since I fixed most of the interaction between the two plugins with this update.
    
    08/11/2013(v3.1415 )
    *Yes, the version numbers are getting ridiculous, but I'm not going to make it 3.15 or 3.2.0 or whatever until I have a bigger update than just bugfixes.
    *Made Heavy mediguns not bonemerge, so they don't end up at the map origin.
    *Fixed issue with empty attribute strings
    *Added some attributes to the Army of One (large explosion!)
    *Fixed builders/sappers
    *If your server is crashing, try downloading this VPK and placing it in "tf/custom/" on your server. Clients don't need to download it, and you might have to restart your server after placing it there for it to be "found".
    *Deflector defaults to have the attack projectiles attribute.
    
    06/04/2013(v3.141 )
    *Fixed worldmodels, hopefully.
    *Fixed Powerup Canteens not equipping properly.
    *Fixed Ap-Sap, I think.
    *May or may not crash on Sappers occasionally, temporary (or possibly permanent) fix will be posted if bug exists.
    *A huge update is in the works that will change a bunch of stuff regarding item effects, etc.
    
    01/23/2013(v3.14 )
    *Fixed "viewmodel" custom config line not working
    *TF2Items_GiveWeapon native now returns the given entity, or -1 on error/failure
    *Made Crossbow reload fix ignore Soldiers because weirdness ensued
    *Charging now resets bashing on all classes properly (you used to be able to bash only once before visiting a resupply locker as a non-Demomen)
    *Megaheal no longer prevents the Mmmmph/Eureka stun time.
    *Prevented possible infinite loop in Amputator effect
    
    12/22/2012(v3.13 )
    *Amputator effect works on all classes
    *Charging on non-Demomen (Targe/Screen) requires that you hold Reload while you press AltFire
    *New weapons added (though if you've got TF2ItemsInfo you'd already have them)
    *New weapon ammo calculation fixed
    
    10/21/2012(v3.12)
    *Cleaned up backstab disguise code a bit
    *Fixed Market Gardener for all classes
    *Fixed Ludmila not behaving properly
    *Altered Ludmila's viewmodel appearance slightly
    *Fixed reload bugs/exploits
    *Fixed shotgun issues with TF2II
    *Updated for TF2II updates
    *Fixed some integer attributes' behavior (133, 143, 147, 152, 184, 185, 186, 192, 193, 194, 198, 211, 214, 227, 228, 229, 262, 294, 302, 372, 373, 374, 379, 381, 383, 403, 420)
    *Updated attributes for some of Valve's updates
    *Fixed crits/minicrits on Chargin' Targe/Splendid Screen
    *Added support for custom viewmodels (they attach to the normal viewmodel) using the "viewmodel" line in the custom config. Look at the custom config instructions section of this post for more info.
    *Added Sleeping Dogs weapons (but not any weapon released after that)
    *If you want ANY of the recently added weapons (botkillers, Freedom Staff, etc), you will need TF2ItemsInfo. Link's right below.
    
    6/30/2012(v3.11)
    *Added TF2ItemsInfo integration, will auto-update weapons.
    *Pyromania update weapons/weapon changes
    *Enforcer/Jumper/Pan/other weapon updates
    *Eyelander headtaking on all classes (beta)
    *Your Eternal Reward backstab disguise on all classes (beta)
    *Fixed rage gain for some weapons
    *Fixed Gunslinger+Kritzkrieg bug
    *Charging fixes
    *Phlogistinator/Eureka Effect work on all classes
    *Fixed Gunslinger/other weapon overheal+givew_ex exploit
    *Let me know if I forgot any notes
    
    3/2/2012(v3.10)
    *Added Black Rose
    *Added Manmelter changes from an update
    *Chargin' Targe and Splendid Screen now work with any class
    *Buff Banner, Battalion's Backup, Concheror now gain charge properly
    *Army of One now uses index 18 internally (still 2228)
    
    12/16/2011(v3.09)
    *Australian Christmas weapons
    *Apoco-Fists and Sharp Dresser
    *Made HHH axe not cover Heavy's face (only applies to 266 and 9266)
    *Updated/added some weapons from TF2 Beta
    *Attempted to make the Chargin' Targe look better on non-Demomen
    
    11/10/2011(Gamedata updated)
    *Please redownload tf2items.randomizer.txt from the Randomizer thread.
    *This fixes a bug where wearable weapons would not be given.
    
    10/27/2011(v3.08)
    *Halloween weapons (Wanga Prick, Unarmed Combat)
    *Changed RemoveEdict to a Kill input for the wearable removal
    
    10/15/2011(v3.07)
    *Manniversary weapons/attribute changes
    *Added some beta weapons, but they may not work correctly
    *Pocket Protector - index 2129: custom Battalion's Backup that builds rage by being healed (gaining health from being healed by a medic). Rage is a minicrit buff that also prevents all buffed players from gaining health from medics for the buff duration.
    
    09/25/2011(v3.06)
    *Valve changed some attributes (e.g. Sticky Jumper) so I mirrored that.
    
    09/11/2011(v3.05)
    *I forgot the Rift weapons in the weapon list on this post. Woops.
    *Added sm_gimme command. Thanks, bottiger!
    *sm_resetex now accepts "slot" or "index" after the target argument, and any numbers after that to reset those indices or slots.
    *Pyros, Heavies, and Soldiers can now taunt with the Reserve Shooter and Family Business.
    
    08/28/2011(v3.04)
    *Original + Manno-Tech weapons
    *Valve updated the attributes on Jarate, mediguns, and two wrenches for the strange quality stuff, so that too.
    07/25/2011(v3.03)
    *Valve weapons are now -9999 to -8000, -7018, 7018, and 8000 to 9999.
    *Wording on the command activity changed
    *Fixed goldslinger model stuff (I still need to post that model somewhere, so don't go looking for it)
    *TF2Items 1.4.7 Force_Generation changes
    *Updates to Uber update weapons that Valve did soon after the update
    *Summer weapons
    *Grordbort weapons
    *Texan Love (2161) is back, but kinda underpowered
    *Targe emulation tweaked for the Uber update changes
    
    06/25/2011(v3.02)
    *Uber update weapons
    */givew for slot 0 weapon (primary slot) will remove the Demo boots  (just as giving a slot 1/secondary weapon removes gunboats, etc)
    *Removed most of the beta weapons since they made it into the Uber update.
    
    06/15/2011(v3.01)
    *Maul and Saxxy added, along with code changes required for saxxy: you  can use "saxxy" as a classname and it will use the classnames the saxxy  uses for each class.
    *Version cvar updates when plugin is reloaded
    
    05/29/2011(v3.0)
    * Visweps.inc is now optional when compiling
    * Added Fishcake, Three Rune Blade
    * Added Beta Weapons: Quick-Fix, Detonator, Beta Syringe Gun, Beta Bonesaw, Pocket Shotgun, Beta Sniper Club, Beta Sniper Rifle
    
    04/24/2011(v2.9)
    * Valve weapons are now 7018, 8000 through 9999, none others.
    * Valve weapon cvar's "allow" value is different, you might wanna go check it out in the source, and update any cfgs.
    * All Timers use UserIds now.
    * Added Golden Gunslinger, will upload a worldmodel soon (visible!)
    * Attempted to make the targe stick to non-demomen's arms for some classes
    * Visible Weapons no longer works, but the code autodisables if it isn't loaded, so no change there...
    * Removed index 31 (valve removed it a loooooong time ago)
    * Updated attributes from April 14th, 2011 Update
    * Fixed Wearable classnames from April 14th, 2011 Update (NOTE: CHANGE ALL tf_wearable_item to tf_wearable, and tf_wearable_item_demoshield to tf_wearable_demoshield)
    * Changed the preparemodels logging lines a bit
    * THE NATIVE HAS CHANGED, added ammo argument. Check the inc.
    
    03/13/2011(v2.8)
    *Reverted Rebel's Curse dissolve to previous
    *Valve weapons are now classified as 7018, 8018, 8045, and all the 9000s
    *Fixed givew_ex causing people in spec/dead to get floating visweps
    *Tried making 2041 (Ludmila) look as it does in VisibleWeapons
    *Removed Medic/Degreaser view fix (half-invis'd degreaser) since it doesn't seem to occur anymore
    *Added FaN/Sniper fix since the FaN seems to block Sniper's crosshair (half-invis'd now)
    *Worldmodels now change for the player themselves, based on the "model" line.
    *You can pass "-1" as the model to make it not send a model to visweps.
    *Added 9266 - the REAL Horsemann's Headtaker- really OP, almost like  you're a Horsemann. It also adds the model and giant axe onto you while  you have it out.
    *Shogun weapons
    *Army of One now has a model, which I'll upload soon.
    *Fixed a 'derp' in PrepareAllModels() that accidentally cut off long model filepaths.
    
    02/24/2011(v2.7)
    *Changed Playerdeath Post hook to Pre hook for the Rebel's Curse. Also  changed its dissolve effect to be "Heavy Lightning" apparently.
    *Added Jar of Ants, index 2058
    *Added Wearable weapons (131, targe; 133, gunboats; 57, razorback; 231, danger shield)
    *Changed Khopesh Climber to be Level 11
    *Rebel's Curse is now 2197 (viewmodel is also working but needs a separate plugin, will post soon).
    *Targe on all classes will sorta work. They charge forward for a bit. Sorta.
    *Added the "Upgradeable" weapon indexes (the indexes for the renamed weapons)
    
    01/09/2011(v2.61)
    *Changed Rebel's Curse and Khopesh Climber effect logic a little to make it less hackily compatible with Randomizer
    01/07/2011(v2.6)
    *Added tf2items_valveweapons and tf2items_customweapons_lowadmins cvar.
    *Added an optional [mode] third argument for givew_ex, if 1, gives right then and there, but also permanent.
    *In the keyvalues cfg, can add a line under the rest for "model" if you have the Visible Weapons plugin also installed. Will set the model  others see to a model you specify. See the box about it below for more details on how to set this up. ALSO: will only work if item index is under 999999. Will change if need be.
    *Made it so weapons that normally block the screen (or at least the crosshair, such as kritzkrieg on sniper) are partially invisible, so you can see you have it out, but see through it too.
    *Forgot from the previous version, if Mecha the Slag joins your server and you are giving out Khopesh Climbers, he gets a self-made one. Makes sense, no? I haven't done this for the weapons I made.
    *If using with VisibleWeapons, all weapons should now have models. Ludmila uses Sasha with the Natascha band. The Khopesh Climber uses a custom model (download link will be in the aforementioned box below). The Rebel's Curse does too. Other ones use their base item models for now, e.g. Army of One uses Black Box.
    -All weapons created in the custom cfg will use the model of their item index, unless specified otherwise.
    *Some fixes to weapon attributes
    *Oh! Rebel's Curse= Purple glowing, pulsing wrench. Right now, for viewmodel, its partially invisible and a bit darker than a golden wrench. I am going to try to get it to fade in and out later. It has attributes. Might need some balancing.
    *The TF2Items_CreateWeapon native changed, so you can do model in that too (for VisibleWeapons)
    *I have to shorten the plugin library name in the next update, which will affect the .inc file. Be warned.
    
    12/18/2010 (v2.5)
    *Added Australian Christmas update weapons
    *Visible Weapons compatibility
    
    12/11/2010 (v1.4.1.2.3)
    *Added tf2items_giveweapon_notify cvar, which determines how to show the plugin's activity. 0- Only show to client using command, 1- Broadcast givew to all with ShowActivity2, but not _ex. 2- Show both to all. (Follows sm_show_activity convar, btw)
    *New weapon 9205
    *Hopefully fixed only getting 2 attributes on the customs cfg
    *Added natives, look inside the tf2items_giveweapon.inc file to see
    *Fixed sticky jumper not showing as one
    
    12/02/2010 (v1.4.1.2.2)
    *Added Khopesh Climber
    *Changed sm_give to sm_givew and sm_give_ex to sm_givew_ex. Update your menus and such!
    *Some fixes hopefully, such as with the custom items file only applying 2 attributes.
    *The Khopesh Climber will fully work with the next Randomizer update if you have it.
    11/19/2010 (v1.4.1.2.1)
    *Added the 11/19 weapons
    *Added Fighter's Falcata- Kukri with faster swing rate and greater damage but does not random crit and you take 15 damage on each hit. Double-edged sword type deal. Still really powerful.
    *Like Valve, changed original Lugermorph to Vintage and the new one is "Unique" unlockable quality (normal unlockable)
    
    11/10/2010 (v1.4.1.2.0)
    *Re-added sm_give_ex as the permanent weapon command.
    *sm_resetex <target> to reset a targets permanent weapons.
    
    11/6/2010 (v1.4.1.1.0)
    *Allowed for a custom weapons config file to define your own custom weapons
    *Fixed the Sticky Jumper showing itself as a normal stickybomblauncher, now it's actually a sticky jumper
    *Removed give_ex for the time being, as it seems very buggy at the moment.
    *^Give_ex is now the permanent weapon command, and does ammo right (gives .1 seconds after locker touch)
    
    10/30/2010 (v1.4.1.0.4)
    *First public release: long before this, asherkin made the original and it was awesome.

    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
    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:
    9018 - Valve Rocket Launcher
    9020 - Valve Sticky Launcher
    9014 - Valve Sniper Rifle
    9013 - Valve Scattergun
    9021 - Valve Flamethrower
    9017 - Valve Syringe Gun
    9015 - Valve Minigun
    9024 - Valve Revolver
    9009 - Valve Engy Shotgun
    9029 - Valve Medigun
    2041 - Ludmila
    9027 - Spycrab PDA
    2061 - Fire Retardant Suit (still testing. It's a revolver that does no damage but proves some type of fire protection, currently set to not set you on fire if you are disguised)
    8018 - Rapidfire Valve Rocket Launcher (VERY CHEAP)
    7018 - Rapidfire Community Rocket Launcher (LESS SO, BUT STILL)
    8045 - what I can only call, "the derpFaN"
    9205 - Try it and find out. Let's just say it's Robin's, and actually exists now rather than in the past.

    BETA WEAPONS (the ones recently added to the TF2 Beta; technically Ludmila should go here but meh. Also NONE OF THESE MAY WORK, I DON'T KNOW.):
    19010 - Beta Pocket Rocket Launcher variant 1
    19011 - Beta Pocket Shotgun
    186 - Beta Quick-Fix
    19012 - Beta Split Equalizer 1
    19013 - Beta Split Equalizer 2
    19015 - Beta Sniper Rifle 1
    19016 - Beta Pocket Rocket Launcher variant 2
    19017 - Beta Pocket Rocket Launcher variant 3

    Custom Item Requests by friends/random adds:
    2129 - Pocket Protector (Battalion's Backup with different Rage mechanic: Build rage by gaining health from medics. Unleash Rage for minicrits, but buff causes inability to gain health from medics for duration of buff).
    2141 - The Texas Ten-Shot (Frontier Justice mod: 10 shots, damage buff for each consecutive shot, more max ammo, very slow reload, also has a domination symbol thing near its muzzle)
    2161 - Texan Love (Big Kill mod, but meant for engy secondary: Faster shooting and more accurate, hopefully can shoot sappers off buildings with a full clip, but slow reload and heals slower)
    2127 - Some special direct hit a friend requested: 2 shot clip, fast shots like the Direct Hit, extra damage like the DH, minicrits airborne targets like the DH, increased damage taken from bullets like the Pain Train
    2159 - A testing Dalokohs Bar weapon I added to see if I could make other classes have temporary +50 max health. It *sorta* works right, but it's more of a testing item, so avoid.
    2433 - Same as above, but for the Fishcake
    2228 - The Army of One: A special type of Black Box that I saw on a YouTube video (used the Direct Hit model in it http://www.youtube.com/watch?v=I0wg0PvP0zg#t=3m58s)
    2009 - A shotgun that uses the Frontier Justice Model but with normal attributes, since the normal shotguns are buggy. Primary Shotty.
    2193 - Fighter's Falcata. Faster fire rate, more damage, but -15 hp when you hit somebody.
    2171 - Khopesh Climber. Climb walls by whacking them! Thanks to Mecha the Slag.
    2197 - Rebel's Curse. It's a wrench. A glowy purple wrench. IT DISSOLVES THINGS.
    2058 - a Jar of Ants
    9266 - Horsemann's OP Headtaker- makes you like the Horsemann!
    5142 - Golden Gunslinger
    How to do custom weapons
    The file tf2items.givecustom.txt goes in addons/sourcemod/configs/
    It's used to create your own custom weapons.
    PHP Code:
    "custom_give_weapons_vlolz"
    {
        
    "9999"
        
    {
            
    "classname"        "tf_weapon_rocketlauncher"
            "index"        "228"
            "slot"        "0"
            "quality"        "6"
            "level"        "29"
            "attribs"        "134 ; 19"
            "ammo"        "20"
        
    }
        
    "1304"
        
    {
            
    "classname"        "tf_weapon_knife"
            "index"        "225"
            "slot"        "2"
            "quality"        "6"
            "level"        "2"
            "attribs"        "215 ; 9999.0 ; 1 ; 0.5"
            "ammo"        "-1"
            "model"        "models/whatever.mdl"
        
    }

    At the top of the file is custom_give_weapons_vlolz, which shouldn't change.
    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:
    "custom_give_weapons_vlolz"   //leave this alone
    {
        
    "9999"   //index you want the weapon set as (/givew @me thisnumber)
        
    {
            
    "classname"        "tf_weapon_rocketlauncher" // weapon classname
            
    "index"        "228"   //actual weapon index
            
    "slot"        "0"   //slot 0 - 5 for primary to whatever the last slot is (build box?)
            
    "quality"        "6" //item quality, as in strange, vintage, unique, etc.
            
    "level"        "29" //level, simple.
            
    "attribs"        "134 ; 19" //attributes.
            
    "ammo"        "20" //initial ammo to set for that weapon when it's given
            
    "model"       "models/player/heavy.mdl"  //change the worldmodel of the weapon. if it's a custom model, read the stuff below
            
    "viewmodel"        "models/weapons/c_models/c_bigaxe/c_bigaxe.mdl" //used to attach a model to the viewmodel of the weapon. Try not to use a model that already has hands on it (so use the w_model/c_model if you can).
        
    }

    HOW TO DO CUSTOM MODELS
    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"
    The FIRST thing the plugin does is look for a .dep file (just like the TF2 Equipment Manager). This is a text file that, on each line, has a different, non-standard file that TF2 needs to both precache and make clients download. SO! the .dep file for the above model would be:

    Code:
    models/custom/weapons/rebelscurse/c_wrench.mdl
    models/custom/weapons/rebelscurse/c_wrench.phy
    models/custom/weapons/rebelscurse/c_wrench.vvd
    models/custom/weapons/rebelscurse/c_wrench.dx90.vtx
    models/custom/weapons/rebelscurse/c_wrench.dx80.vtx
    models/custom/weapons/rebelscurse/c_wrench.sw.vtx
    materials/models/custom/weapons/rebelscurse/rebels_curse.vmt
    materials/models/custom/weapons/rebelscurse/rebels_curse.vtf
    Because it uses those materials and models.
    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.
    Attached Files
    File Type: txt tf2items.givecustom.txt (202 Bytes, 35673 views)
    File Type: inc tf2items_giveweapon.inc (2.9 KB, 20182 views)
    File Type: sp Get Plugin or Get Source (tf2items_giveweapon.sp - 13948 views - 236.8 KB)
    File Type: smx tf2items_giveweapon.smx (73.6 KB, 31833 views)
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 12-28-2021 at 16:42.
    FlaminSarge is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 10-31-2010 , 15:03   Re: [TF2Items] Give Weapon (v2.7, 02/24/2011)
    Reply With Quote #2

    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
    Attached Files
    File Type: zip rebels curse v2.zip (95.8 KB, 4578 views)
    File Type: zip khopesh climber.zip (1.15 MB, 4501 views)
    File Type: zip rebels curse.zip (275.2 KB, 3232 views)
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 04-11-2012 at 22:14.
    FlaminSarge is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-31-2010 , 17:30   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #3

    Quote:
    SourceMod 1.3.4 required.
    Android 1.6, Sourcemod 1.3.4.... whatever's next? Windows 98?
    __________________
    DarthNinja is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 10-31-2010 , 18:13   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #4

    If you can run TF2 on 98, sure. Go ahead.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.
    FlaminSarge is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-31-2010 , 20:41   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #5

    Quote:
    Originally Posted by FlaminSarge View Post
    If you can run TF2 on 98, sure. Go ahead.
    http://www.youtube.com/watch?v=xfyYzI_WbYQ
    __________________
    DarthNinja is offline
    TheKisho
    Junior Member
    Join Date: Jun 2010
    Location: Kitchener, Ontario, Cana
    Old 11-01-2010 , 11:30   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #6

    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.
    TheKisho is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 11-01-2010 , 11:41   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #7

    suggestion: add some natives for other developers to use this.

    pretty please :]
    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 11-01-2010 , 21:22   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #8

    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
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 11-01-2010 at 21:29.
    FlaminSarge is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 11-02-2010 , 07:47   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #9

    Quote:
    Originally Posted by FlaminSarge View Post
    Also thrawn I have a weapon replace plugin that can replace the sandvich with the shotgun, etc. Sit tight, I'll release it sometime soon or add it to tNoUnlocksPls
    Uhm, i dont understand. tNoUnlocksPls has no issues at all replacing the sandvich with a shotgun. What do you want to add?
    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 11-02-2010 , 19:11   Re: [TF2Items] Give Weapon (v1.4.1.0.4, 10/30/2010)
    Reply With Quote #10

    Lol woops I read wrong. It WOULD be awesome to make a sandvich have the attributes of a shotgun, though

    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).
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 11-02-2010 at 19:23.
    FlaminSarge 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:43.


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