Monthly Target: $400 Donations: $334
 83% 

[TF2] Set Class


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Tylerst
Veteran Member
Join Date: Oct 2010
Plugin ID:
2028
Plugin Version:
1.2.2
Plugin Category:
Admin Commands
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Approver:
    Plugin Description:
    Change a target(s) class.
    Servers with this Plugin:
    505 
    Old 10-25-2010 , 01:48   [TF2] Set Class
    Reply With Quote #1

    TF2 Set Class

    Description: Set a target(s) class to the specified one, simple enough eh?

    CVARs(Default Values Shown):
    sm_setclass_version "1.2.2"

    sm_setclass_chat "1" - Enable/Disable(1/0) Showing setclass changes in chat

    sm_setclass_log "1" - Enable/Disable(1/0) Logging of setclass changes


    Command: sm_setclass "target" "class" (Default Slay Flag)
    Note: Canuse "random" for class to have the plugin choose a random class

    Examples:
    sm_setclass Thatonedude Soldier
    sm_setclass "The Master Stalker" Spy
    sm_setclass @me PYRO
    sm_setclass @red EnGiNeEr
    sm_setclass @humans scout
    sm_setclass @bots medic
    sm_setclass @all random

    Changelog:
    Code:
    Version 1.0.0 - October 25, 2010 
    * Initial release.
     
    Version 1.0.1 - October 26, 2010
    * Fixed a glitch with setting a target's class while they're taunting (Thanks Thraka)
     
    Version 1.1.0 - November 2, 2010
    * Added ability to use 'random' to allow the plugin to pick a random class
    * Logging will now specify whether the command or the admin menu was used to change class
     
    Version 1.2.0 - July 23, 2011
    * Overhaul of original plugin code for stability and optimization
    * Removed menu version(adminmenu_custom example attached)
    
    Version 1.2.1 - December 24, 2011
    * Using "random" with multiple targets will now randomize each individual target's class
    
    Version 1.2.2 - May 20, 2012
    * Added extra Validity checks to prevent errors
    Attached Files
    File Type: txt Setclass menu example.txt (456 Bytes, 1873 views)
    File Type: sp Get Plugin or Get Source (TF2 Set Class.sp - 4803 views - 4.2 KB)

    Last edited by Tylerst; 05-20-2012 at 21:00. Reason: Weird font change
    Tylerst is offline
    Snaggle
    SourceMod Donor
    Join Date: Jul 2010
    Location: England
    Old 10-25-2010 , 18:12   Re: TF2 Setclass
    Reply With Quote #2

    Awesome, fits my servers nicely. Good job!
    __________________
    - Ach Factory
    - Bot Killing
    Snaggle is offline
    Thraka
    SourceMod Donor
    Join Date: Aug 2005
    Old 10-26-2010 , 13:11   Re: TF2 Setclass
    Reply With Quote #3

    Use this to force a player to select a weapon after you regenerate them

    new weapon = GetPlayerWeaponSlot(client, 1);
    SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
    Thraka is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 10-26-2010 , 19:44   Re: TF2 Setclass
    Reply With Quote #4

    Quote:
    Originally Posted by Thraka View Post
    Use this to force a player to select a weapon after you regenerate them

    new weapon = GetPlayerWeaponSlot(client, 1);
    SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
    Thanks for that, Plugin updated.

    Also, I used slot 0 for primary instead of 1 for secondary.
    Tylerst is offline
    Thraka
    SourceMod Donor
    Join Date: Aug 2005
    Old 10-26-2010 , 19:56   Re: TF2 Setclass
    Reply With Quote #5

    Sure. I just pasted that from another plugin i know uses it
    Thraka is offline
    TimeShift
    Member
    Join Date: Aug 2009
    Old 11-02-2010 , 00:11   Re: TF2 Setclass
    Reply With Quote #6

    Just what I needed, I love you

    Could you make something to change the player's class to a random class?

    Like "sm_setclass @bots random" then the plugin chooses a random class
    TimeShift is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 11-02-2010 , 12:41   Re: TF2 Setclass
    Reply With Quote #7

    Quote:
    Originally Posted by TimeShift View Post
    Just what I needed, I love you

    Could you make something to change the player's class to a random class?

    Like "sm_setclass @bots random" then the plugin chooses a random class
    Done
    Tylerst is offline
    Agentnightslayer
    New Member
    Join Date: Feb 2011
    Old 02-28-2011 , 15:47   Re: [TF2] Set Class
    Reply With Quote #8

    On my Server I run the High Five Plugin(https://forums.alliedmods.net/showthread.php?t=147305) with this and it seems to leave behind a lot of civilian models from the original class the person was. Is there any way to get rid of the models/fix this?

    Agentnightslayer is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 02-28-2011 , 18:31   Re: [TF2] Set Class
    Reply With Quote #9

    Quote:
    Originally Posted by Agentnightslayer View Post
    On my Server I run the High Five Plugin(https://forums.alliedmods.net/showthread.php?t=147305) with this and it seems to leave behind a lot of civilian models from the original class the person was. Is there any way to get rid of the models/fix this?

    Just glancing at the code, it should only be a problem if you use it mid high-five. If that's the case, I'll see what I can do, such as disallow setclass during taunts if sm_high_five_version cvar is found.

    If you have this problem with setting class and doing the high-five after, then I'm not sure what I can do to fix it. The high-five plugin seems to check class/model, make the player invisible, and spawn a new model to play the animation during a stun state(to allow thirdperson I assume), hence this plugin shouldn't cause an issue since it changes the class(and the model) if used before the high-fire.
    Tylerst is offline
    Agentnightslayer
    New Member
    Join Date: Feb 2011
    Old 03-01-2011 , 16:31   Re: [TF2] Set Class
    Reply With Quote #10

    Alright cool thanks. This plugin is very helpful otherwise
    Agentnightslayer 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 11:21.


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