Raised This Month: $32 Target: $400
 8% 

[TF2] Simple Instant Class Change Snip.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-27-2017 , 19:25   [TF2] Simple Instant Class Change Snip.
Reply With Quote #1

A simple bit that changes your class instantly, no respawn required. I'm sure there are other versions of this out there but it was simple and I figured others could use it. So I shared

Source
Spoiler



https://www.youtube.com/watch?v=DX9zROxi0Do
Halt is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 10-28-2017 , 15:03   Re: [TF2] Simple Instant Class Change Snip.
Reply With Quote #2

Thx for this!
ThatKidWhoGames is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-31-2017 , 15:36   Re: [TF2] Simple Instant Class Change Snip.
Reply With Quote #3

Couldn't this loop if you dont check the clients class is already equal to the class you're forcing?
__________________
Neuro Toxin is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-31-2017 , 17:38   Re: [TF2] Simple Instant Class Change Snip.
Reply With Quote #4

This is nice, however is there any difference between setting m_iClass instead of TF2_SetPlayerClass?
Currently Regenerating a player after SetPlayerClass has weird effects, like visually setting the player to that class but some times not their health (however the max health changes) and some of the wearables that are for all classes. I.e. spy wearing heavy's Triad Trinket.

Quote:
Originally Posted by Neuro Toxin View Post
Couldn't this loop if you dont check the clients class is already equal to the class you're forcing?
Setting m_iClass doesn't trigger the class change event.

Last edited by Mitchell; 10-31-2017 at 17:40.
Mitchell is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 10-31-2017 , 21:38   Re: [TF2] Simple Instant Class Change Snip.
Reply With Quote #5

Quote:
Originally Posted by Mitchell View Post
This is nice, however is there any difference between setting m_iClass instead of TF2_SetPlayerClass?
Currently Regenerating a player after SetPlayerClass has weird effects, like visually setting the player to that class but some times not their health (however the max health changes) and some of the wearables that are for all classes. I.e. spy wearing heavy's Triad Trinket.



Setting m_iClass doesn't trigger the class change event.
I was gonna say including tf2_stocks and adding TF2_SetPlayerClass makes the code look a lot neater.
ThatKidWhoGames 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 17:25.


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