[TF2 MvM] Destroy/Edit The Tank via SM
So I want an admin command called "sm_destroy_tank" that will scan the map for all active tank entities and either:
(A) Force the tank that the admin wants destroyed to explode (B) Change the health of the tank (raise it, lower it, etc) So this code would find all the active tanks on the map: PHP Code:
Datamaps:
Spoiler
Netprops:
Spoiler
Thanks for any and all help! EDIT: I do see this on the datamaps dump: PHP Code:
The sv_cheats 1 command tf_mvm_tank_kill will force a tank on the map to explode, so that's something I want to write an SM command alias of (but with more options). |
Re: [TF2 MvM] Destroy/Edit The Tank via SM
Have you tried using SDKHooks_TakeDamage on the tank entity to deal it damage?
As for changing health, it has AddHealth and RemoveHealth inputs... |
Re: [TF2 MvM] Destroy/Edit The Tank via SM
Quote:
Quote:
Thanks for the help Ross! |
Re: [TF2 MvM] Destroy/Edit The Tank via SM
The SDKTools extension has commands for triggering inputs.
Assuming AddHealth takes an int number... PHP Code:
|
Re: [TF2 MvM] Destroy/Edit The Tank via SM
SDKHooks_TakeDamage did the job perfectly well:
PHP Code:
|
Re: [TF2 MvM] Destroy/Edit The Tank via SM
Untested solution to the problem.
PHP Code:
When someone whacks the tank again the game will re-calculate m_lastHealthPercentage, so I think it should be set correctly, but if not, it will be adjusted anyway. Again, not tested, but this should do the trick. I'll have to test it later. |
Re: [TF2 MvM] Destroy/Edit The Tank via SM
PHP Code:
|
Re: [TF2 MvM] Destroy/Edit The Tank via SM
I wonder if setting SDKHooks_TakeDamage to a negative value would actually add health...
|
Re: [TF2 MvM] Destroy/Edit The Tank via SM
Quote:
The command hurtme -99 overheal too. I guess it work too with SDKHooks_TakeDamage |
All times are GMT -4. The time now is 19:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.