Raised This Month: $51 Target: $400
 12% 

[TF2] Hat Removal


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Monkeys
Veteran Member
Join Date: Jan 2010
Plugin ID:
2345
Plugin Version:
1.1a
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    5 
    Plugin Description:
    Adds the option to hide hats on your server
    Old 05-19-2011 , 13:04   [TF2] Hat Removal
    Reply With Quote #1

    Hat Removal


    Description:
    Gives players the possibility to toggle hats. Simple as that.
    Don't want to see hats in your War-themed Hat Simulation? Type !togglehat or /togglehat and voila! No more hats!
    Want to take it a step further? Set the sm_hatremoval_mode convar to 1 and it'll remove hats entirely for everybody.

    Info:
    sm_hatremoval_mode can be set to
    | 0 : Sets plugin inactive.
    | 1 : Force hat removal.
    | 2 : Players can toggle hat-mode. {default}

    This removes hats, but also other cosmetic items like badges.
    If you want badges and sortlike to be exceptions (or simply separate), voice it.


    Requires SDKHooks!

    Change log:
    v1.1 :
    * The Razorback, Gunboats and Darwin's Danger Shield added as exceptions.
    * Added a 20 second delay between subsequent messages to reduce spam.
    a :
    * Fixed Having a PrintToChatAll instead of PrintToChat causing spam.
    v1.0 :
    * First release


    I did a quick search and didn't find any other hat hiding SM plugins, so I uploaded mine. If there was one and I'm blind, slap me with a trout and remove this.
    Attached Files
    File Type: sp Get Plugin or Get Source (Hat_Removal.sp - 998 views - 3.8 KB)
    File Type: smx Hat_Removal.smx (4.5 KB, 871 views)
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.

    Last edited by Monkeys; 05-25-2011 at 02:07.
    Monkeys is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 05-19-2011 , 13:13   Re: [TF2] Hat Removal
    Reply With Quote #2

    Looks good. Only thing I can think of is this extension, but I think it needs updatin': http://forums.alliedmods.net/showthread.php?t=145218
    __________________
    pheadxdll is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 05-19-2011 , 13:44   Re: [TF2] Hat Removal
    Reply With Quote #3

    hmm, you should be able to distinguish between hats and medals using this: https://forums.alliedmods.net/showthread.php?t=154480
    check for "item_type_name" == "#TF_Wearable_Badge"

    to get an array of all medals you would do this:
    PHP Code:
    new Handle:hArray ItemsGameSearch("classname => tf_wearable_item, slot => misc, item_type_name => #TF_Wearable_Badge"ITEMSGAME_RETURN_INDEX); 
    for (new 
    0GetArraySize(hArray); i++) { 
        
    LogMessage("Index %d is a medal"GetArrayCell(hArrayi)) 

    CloseHandle(hArray); 
    edit:
    in your case you will need to get the the item definition index using m_iItemDefinitionIndex. and then use
    native bool:ItemsGameInfo(iIndex, String:strInfo[], String:strReturn[], iMaxSize);
    to get the item_type_name.

    also, optional clientprefs support would make this plugin complete.
    __________________
    einmal mit profis arbeiten. einmal.

    Last edited by Thrawn2; 05-19-2011 at 13:51.
    Thrawn2 is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 05-19-2011 , 14:19   Re: [TF2] Hat Removal
    Reply With Quote #4

    I tend to dislike having too many dependencies, as should anyone.
    I didn't mind using SDKHooks because, well, nearly everybody has it.

    The method I've used is simple with a low overhead and has been working for the past few years.

    I have been thinking of adding clientprefs, but with a mere one preference to set I kind of shoo'ed it off. If the demand for medal/pin exceptions is present, I'll probably add it.

    No more need for the list anyway, I figure the TF2Wiki's up to date
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    casvdry
    Member
    Join Date: Mar 2008
    Old 05-19-2011 , 17:35   Re: [TF2] Hat Removal
    Reply With Quote #5

    Doesn't using tf_wearable disable display of razorback?
    casvdry is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 05-20-2011 , 01:21   Re: [TF2] Hat Removal
    Reply With Quote #6

    ^This is true. Check the item index of the wearable, if it's 57, 131, 133, or 231 (I think), then it's one of the weapons, not a hat/badge.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno 64-bit 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
    ck0
    Junior Member
    Join Date: May 2011
    Old 05-20-2011 , 14:13   Re: [TF2] Hat Removal
    Reply With Quote #7

    Just didnt like the spam that makes it into the chat at the beginning of the round. =/

    Code:
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    Control Point Bonus refreshed!
    (o) ck #tf2m :  quem?
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    (o) ck #tf2m :  RVG bbM : meu time ganhou a lbtf
    Player D' Chield has joined the game
    (Voice) ENTRA AEW SNIPER: MEDIC!
    Player §{S.A.D}§ Charles TR - SEM SO has joined the game
    This server is running Hat Removal, all hats have been removed.
    Player esky has joined the game
    Player Sheldon Cooper has joined the game
    Ready or not, here they come!
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    MuCA has found: The Holy Mackerel
    Control Point Bonus refreshed!
    Control point bonus! Health filled.
     Currlllent Map: ph_maze_a4
    (Voice) | Kenshin: MEDIC!
    RtOP | Chapa :  mitei, fala serio
    (Voice) | Kenshin: MEDIC!
    This server is running Hat Removal, all hats have been removed.
    ENTRA AEW SNIPER has traded for:  Villain's Veil
    (Voice) | Kenshin: MEDIC!
    Control Point Bonus refreshed!
    (Voice) | Kenshin: MEDIC!
    Player chegsfd.das has joined the game
    Control point bonus! Health filled.
    (o) ck #tf2m :  UAHEUAHEUHAE
    Miniminido1990 :  nossa
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    This server is running Hat Removal, all hats have been removed.
    Miniminido1990 :  mano
    This server is running Hat Removal, all hats have been removed.
    Control Point Bonus refreshed!
    This server is running Hat Removal, all hats have been removed.
    (Voice) esky: Go! Go! Go!
    You are now disguised as a Metal Pile
    This server is running Hat Removal, all hats have been removed.
    (TEAM) (o) ck #tf2m :  !propmenu
    Ready or not, here they come!
    You are now disguised as a Pillar
    Player « Åℓ » †[Pd]Paladio† has joined the game
    Player renato :B  rnt; has joined the game
    Player [¿!?] !cdlk7; +JESUSCULTURE has joined the game
     Currlllent Map: ph_maze_a4
    Control Point Bonus refreshed!
    This server is running Hat Remo

    Last edited by ck0; 05-20-2011 at 14:28.
    ck0 is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 05-20-2011 , 21:58   Re: [TF2] Hat Removal
    Reply With Quote #8

    The message only displays on Spawn. But on round start, it basicly spawns you several times (selecting class, etc...).

    I'll add the fixes for all what's been said so far into the next version/step/whatever. (EDIT: Which will be tonight, thank you shitty schedules)
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.

    Last edited by Monkeys; 05-21-2011 at 10:57.
    Monkeys is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 05-21-2011 , 14:55   Re: [TF2] Hat Removal
    Reply With Quote #9

    Quote:
    Originally Posted by FlaminSarge View Post
    ^This is true. Check the item index of the wearable, if it's 57, 131, 133, or 231 (I think), then it's one of the weapons, not a hat/badge.
    Just a fyi, but the Charge 'n Targe (131) is nolonger a tf_wearable, but a tf_wearable_demoshield.
    The Razorback, Gunboats and Darwin's Danger Shield added as exceptions.

    Added a 20 second delay between subsequent messages to reduce spam.
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    RavensBro
    Veteran Member
    Join Date: Sep 2009
    Location: Wisonsin USA
    Old 05-24-2011 , 09:49   Re: [TF2] Hat Removal
    Reply With Quote #10

    i couldn't get it to work at first it said the plugin didn't load but then i saw you had a space in between the words Hat Removal.smx. So then i made it to Hat_Removal.smx then it loaded.
    RavensBro is offline
    Reply



    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 09:26.


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