Monthly Target: $400 Donations: $176
 44% 

[L4D & L4D2] Hats (1.13) [29-Mar-2015]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
Veteran Member
Join Date: Aug 2010
Location: Space
Plugin ID:
2288
Plugin Version:
1.13
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Approver:
    Plugin Description:
    Hats, using various models.
    Servers with this Plugin:
    74 
    Old 03-29-2011 , 06:21   [L4D & L4D2] Hats (1.13) [29-Mar-2015]
    Reply With Quote #1

    About:

    Not your average hats...
    [IMG]http://img571.**************/img571/9236/hataj.jpg[/IMG] [IMG]http://img692.**************/img692/5427/hatbe.jpg[/IMG]


    Thanks:
    • Mr.RuyC - For helping test the plugin on his server.
    • Ja-Forces - Creating an "error" free L4D1 hats config + bug reports. (found here)
    • bubbabyte - Testing 1.5 on their server and reporting several bugs.
    • Don't Fear The Reaper - German translations.
    • Ja-Forces - L4D1 data config found here: https://forums.alliedmods.net/showpo...7&postcount=57


    Bugs:
    • Hats covering a players eyes can block the players "use" function (opening doors etc). - No fix (reposition models or delete).


    Changing Models:
    • The position, angles and model name is saved to l4d_hats.cfg in your servers \addons\sourcemod\data\ folder.
    • Each model has it's own section and each section is numbered from 1 to the current max of 64.
    • Each section has 3 keys. "mod" which is required and the path to the model / hat.
    • The 2 optional keys: "ang" and "pos" store the angle / position and can be set in-game with sm_hatang and sm_hatpos.
    • You can customise the hat names with the "name" key as seen in the example below.

    To edit models:
    1. You can view the model list and indexes by typing sm_hatlist.
    2. Use sm_hatadd to add a model to the config (must be the full model path as seen below).
    3. You can remove hats by typing sm_hatdel and part of the model name or the index number (1-64).

    To edit hat positions:
    1. Choose your hat with the sm_hat command.
    2. Use the command sm_hatload to load on all players.
    3. Use the commands sm_hatpos and sm_hatang.
    4. These affect all players (which is why I recommend using sm_hatload)
    5. Once you're happy with the pos/ang use the command sm_hatsave.

    To edit hat sizes:
    1. Choose your hat with the sm_hat command.
    2. Use the command sm_hatload to load on all players.
    3. Use the command sm_hatsize to set the size.
    4. This affects all players (which is why I recommend using sm_hatload)
    5. Once you're happy with the size use the command sm_hatsave.
    6. NOTE: Not all models can be resized.


    Example:
    Code:
    "1"
    {
    	"mod"		"models/infected/gibs/gibs.mdl"
    	"ang"		"0.000000 0.000000 0.000000"
    	"loc"		"2.000000 0.500000 0.500000"
    	"size"		"1.5"
    	"name"		"Hand Gib"
    }


    Commands:

    PHP Code:
    // All players
    sm_hat         // Displays a menu of hats allowing players to change what they are wearing.
    sm_hatoff      // Toggle to turn on or off the ability of wearing hats.
    sm_hatshow     // Toggle to see or hide your own hat.
    sm_hatview     // ^^

    // Admins only (requires "z" flag):
    sm_hatc        // Displays a menu listing players, select one to change their hat
    sm_hatoffc     // Toggle the ability of wearing hats on specific players.
    sm_hatrandom   // Randomizes all players hats.
    sm_hatrand     // ^^

    // Add and remove hat models with these commands.
    sm_hatadd      // Adds specified model to the config (must be the full model path).
    sm_hatdel      // Removes a model from the config (either by index or partial name matching).
    sm_hatlist     // Displays a list of all the hat models and indexs (for use with sm_hatdel).

    // These commands are useful for editing the hat appearances.
    sm_hatsave     // Saves the hat origin and angles to the data config.
    sm_hatload     // Changes all players hats to the one you have.
    sm_hatpos      // Displays a menu allowing you to adjust the hat position (affects all hats/players).
    sm_hatang      // Displays a menu allowing you to adjust the hat angles (affects all hats/players).
    sm_hatsize     // Shows a menu allowing you to adjust the hat size (affects all hats/players). 


    Cvars:

    Saved to l4d_hats.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d_hats_allow "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d_hats_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d_hats_modes_off ""

    // (L4D2 only) Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d_hats_modes_tog ""

    // Specify admin flags or blank to allow all players access to the hats menu.
    l4d_hats_menu ""

    // How transparent or solid should the hats appear. 0=Translucent, 255=Opaque.
    l4d_hats_opaque "255"

    // Attach a random hat when survivors spawn. 0=Never. 1=On round start. 2=Only first spawn (keeps the same hat next round).
    l4d_hats_random "1"

    // 0=Off, 1=Save the players selected hats and attach when they spawn or rejoin the server.
    l4d_hats_save "1"

    // When a player is in third person view, display their hat. Hide when in first person view.
    l4d_hats_third "1"

    // Make a players hat visible by default when they join. 0=No. 1=Yes.
    l4d_hats_view "0"

    // Hats plugin version.
    l4d_hats_version 


    Changes:
    Code:
    1.13 (29-Mar-2015)
        - Fixed the plugin not working in L4D1 due to a SetEntPropFloat property not found error.
    
    1.12 (07-Oct-2012)
        - Fixed hats blocking players +USE by adding a single line of code - Thanks to "Machine".
    
    1.11 (30-Jun-2012)
        - Fixed cvar "l4d_hats_random" from not working properly - Thanks to "Don't Fear The Reaper" for reporting.
    
    1.10 (20-Jun-2012)
        - Added German translations - Thanks to "Don't Fear The Reaper".
        - Small fixes.
    
    1.9 (22-May-2012)
        - Fixed multiple hat changes only showing the first hat to players.
        - Changing hats will no longer return the player to firstperson if thirdperson was already on.
    
    1.8 (21-May-2012)
        - Fixed command "sm_hatc" making the client thirdpeson and not the target.
    
    1.7 (20-May-2012)
        - Added cvar "l4d_hats_change" to put the player into thirdperson view when they select a hat, requested by "disawar1".
    
    1.6.1 (15-May-2012)
        - Fixed a bug when printing to chat after changing someones hat.
        - Fixed cvar "l4d_hats_menu" not allowing access if it was empty.
    
    1.6 (15-May-2012)
        - Fixed the allow cvars not affecting everything.
    
    1.5 (10-May-2012)
        - Added translations, required for the commands and menu title.
        - Added optional translations for the hat names as requested by disawar1.
        - Added cvar "l4d_hats_allow" to turn on/off the plugin.
        - Added cvar "l4d_hats_modes" to control which game modes the plugin works in.
        - Added cvar "l4d_hats_modes_off" same as above.
        - Added cvar "l4d_hats_modes_tog" same as above, but only works for L4D2.
        - Added cvar "l4d_hats_save" to save a players hat for next time they spawn or connect.
        - Added command "sm_hatsize" to change the scale/size of hats as suggested by worminater.
        - Fixed "l4d_hats_menu" flags not setting correctly.
        - Optimized the plugin by hooking cvar changes.
        - Selecting a hat from the menu no longer returns to the first page.
    
    1.4.3 (07-May-2011)
        - Added "name" key to the config for reading hat names.
    
    1.4.2 (16-Apr-2011)
        - Changed the way models are checked to exist and precached.
    
    1.4.1 (16-Apr-2011)
        - Added new hat models to the config. Deleted and repositioned models blocking the "use" function.
        - Changed the hat entity from prop_dynamic to prop_dynamic_override (allows physics models to be attached).
        - Fixed command "sm_hatadd" causing crashes due to models not being pre-cached, cannot cache during a round, causes crash.
        - Fixed pre-caching models which are missing (logs an error telling you an incorrect model is specified).
    
    1.4.0 (11-Apr-2011)
        - Added cvar "l4d_hats_opaque" to set hat transparency.
        - Changed cvar "l4d_hats_random" to create a random hat when survivors spawn. 0=Never. 1=On round start. 2=Only first spawn (keeps the same hat next round).
        - Fixed hats changing when returning from idle.
        - Replaced underscores (_) with spaces in the menu.
    
    1.3.4 (09-Apr-2011)
        - Fixed hooking L4D2 events in L4D1.
    
    1.3.3 (07-Apr-2011)
        - Fixed command "sm_hatc" not displaying for admins when they are dead/infected team.
        - Minor bug fixes.
    
    1.3.2 (06-Apr-2011)
        - Fixed command "sm_hatc" displaying invalid player.
    
    1.3.1 (05-Apr-2011)
        - Fixed the fix of command "sm_hat" flags not applying.
    
    1.3 (05-Apr-2011)
        - Fixed command "sm_hat" flags not applying.
    
    1.2 (03-Apr-2011)
        - Added command "sm_hatoffc" for admins to disable hats on specific clients.
        - Added cvar "l4d_hats_third" to control the previous update's addition.
    
    1.1.1a (03-Apr-2011)
        - Added events to show / hide the hat when in third / first person view.
    
    1.1.1 (02-Apr-2011)
        - Added cvar "l4d_hats_view" to toggle if a players hat is visible by default when they join.
        - Resets variables for clients when they connect.
    
    1.1 (01-Apr-2011)
        - Added command "sm_hatoff" - Toggle to turn on or off the ability of wearing hats.
        - Added command "sm_hatadd" - To add models into the config.
        - Added command "sm_hatdel" - To remove a model from the config.
        - Added command "sm_hatlist" - To display a list of all models (for use with sm_hatdel)
    
    1.0 (29-Mar-2011)
        - Initial release.


    Compiling:
    1. Put the SDKHooks include into your \addons\sourcemod\scripting\include\ folder.
    2. Put the colors.inc include into your \addons\sourcemod\scripting\include\ folder.
    3. Put this plugins .sp file into your \addons\sourcemod\scripting\ folder.
    4. Compile the plugin.


    Requirements:
    • This plugin requires the SDKHooks extension, which is now part of SourceMod 1.5+ and not required as a separate download.


    Installation:
    1. Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.
    • L4D1 users should download and replace the data config created by Ja-Forces: https://forums.alliedmods.net/showpo...7&postcount=57
    • Optionally download the "hatnames.phrases.txt" and put into your servers \addons\sourcemod\translations\ folder.
    • Use this if you want to translate hat names into multiple languages, otherwise just use the "name" key value in the data config.

    Updating from 1.3.4 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.

    Current Translations: English (en), German (de).
    Attached Files
    File Type: txt hatnames.phrases.txt (1.6 KB, 1403 views)
    File Type: zip l4d_hats.zip (42.1 KB, 213 views)
    __________________

    Last edited by Silvers; 06-12-2015 at 15:39.
    Silvers is offline
    kaybeebiscuits
    Junior Member
    Join Date: Jan 2011
    Old 03-29-2011 , 09:36   Re: [L4D & L4D2] Hats
    Reply With Quote #2

    Very interesting mod, I just hope we do not have to idle for them ...
    kaybeebiscuits is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: Soviet Union
    Old 03-29-2011 , 10:22   Re: [L4D & L4D2] Hats
    Reply With Quote #3

    hats are in tf2.
    hats are in css.
    hats are in l4d(2) now!
    hats are everywhere!
    Leonardo is offline
    ShanXin
    Member
    Join Date: May 2010
    Old 03-30-2011 , 23:50   Re: [L4D & L4D2] Hats
    Reply With Quote #4

    LOVE IT !!!!!!!!!!!
    I just love what the people think when they join my server, their reactions are just priceless and they like it in my server.
    2 suggestions:

    1. Make it so you can actually see your own hat, liek when you get smoked or if you have 3rd person enabled
    2. Make it so you can have the option to not wear a hat
    ShanXin is offline
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 03-31-2011 , 02:54   Re: [L4D & L4D2] Hats
    Reply With Quote #5

    yeah , thx for the plugin
    really funny
    __________________
    alexip121093 is offline
    Send a message via MSN to alexip121093
    bzellinger
    Member
    Join Date: Sep 2010
    Old 03-31-2011 , 20:19   Re: [L4D & L4D2] Hats
    Reply With Quote #6

    Could someone post a sample config for l4d1? I look in the model folder and all I see are .vtx files. Or could someone tell me where the folder location is of these mdl files?
    bzellinger is offline
    Silvers
    Veteran Member
    Join Date: Aug 2010
    Location: Space
    Old 03-31-2011 , 20:49   Re: [L4D & L4D2] Hats
    Reply With Quote #7

    @ShanXin Tomorrow I'll release an update which lets you not wear hats (by sm_hatoff command). Do you want the hat visible automatically when you go into thirdperson / smoked etc? It's a good idea but maybe long, will have into it.

    @bzellinger I used hammer to view the models. Basically create a map, add a prop entity and when you select a model and click ok, it shows the full path.

    I made and tested this on L4D2 only so I assume some models will be missing when used in L4D1... if someone could post an L4D1 specific config that would be greatly appreciated.
    __________________
    Silvers is offline
    ShanXin
    Member
    Join Date: May 2010
    Old 03-31-2011 , 21:26   Re: [L4D & L4D2] Hats
    Reply With Quote #8

    Quote:
    Originally Posted by Silvers View Post
    @ShanXin Tomorrow I'll release an update which lets you not wear hats (by sm_hatoff command). Do you want the hat visible automatically when you go into thirdperson / smoked etc? It's a good idea but maybe long, will have into it.

    @bzellinger I used hammer to view the models. Basically create a map, add a prop entity and when you select a model and click ok, it shows the full path.

    I made and tested this on L4D2 only so I assume some models will be missing when used in L4D1... if someone could post an L4D1 specific config that would be greatly appreciated.
    Yeah, so you can see you're own hat
    ShanXin is offline
    Silvers
    Veteran Member
    Join Date: Aug 2010
    Location: Space
    Old 03-31-2011 , 21:29   Re: [L4D & L4D2] Hats
    Reply With Quote #9

    You can currently toggle the hat visibility by typing !hatshow or !hatview but then it's either on or off, and not automatic when changing between thirdperson. Will that be enough or do you want the automatic stuff?
    __________________
    Silvers is offline
    ShanXin
    Member
    Join Date: May 2010
    Old 03-31-2011 , 23:02   Re: [L4D & L4D2] Hats
    Reply With Quote #10

    Quote:
    Originally Posted by Silvers View Post
    You can currently toggle the hat visibility by typing !hatshow or !hatview but then it's either on or off, and not automatic when changing between thirdperson. Will that be enough or do you want the automatic stuff?
    Its okay for me, but then it'll be a pain constantly doing this lol:
    Player: How do I see my hat? D: or What's my hat??
    Jason: TYPE /hatview PLZ

    So I guess either making it into a cvar whether it starts as on/off or making it automatic would be nice, so yeah

    Last edited by ShanXin; 03-31-2011 at 23:04.
    ShanXin 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 10:01.


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