AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TF2] Simple Instant Class Change Snip. (https://forums.alliedmods.net/showthread.php?t=302402)

Halt 10-27-2017 19:25

[TF2] Simple Instant Class Change Snip.
 
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 :bacon!: :bacon!:

Source
Spoiler



https://www.youtube.com/watch?v=DX9zROxi0Do

ThatKidWhoGames 10-28-2017 15:03

Re: [TF2] Simple Instant Class Change Snip.
 
Thx for this!

Neuro Toxin 10-31-2017 15:36

Re: [TF2] Simple Instant Class Change Snip.
 
Couldn't this loop if you dont check the clients class is already equal to the class you're forcing?

Mitchell 10-31-2017 17:38

Re: [TF2] Simple Instant Class Change Snip.
 
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 (Post 2557800)
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.

ThatKidWhoGames 10-31-2017 21:38

Re: [TF2] Simple Instant Class Change Snip.
 
Quote:

Originally Posted by Mitchell (Post 2557812)
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.


All times are GMT -4. The time now is 18:53.

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