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

[TF2 MvM] Detect Upgrade Refund Usage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 10-03-2015 , 21:29   [TF2 MvM] Detect Upgrade Refund Usage
Reply With Quote #1

I need to write a native that gets called when a client uses an upgrade refund credit.

Given the following RELIABLE information:

- SDKHook_EndTouch gets fired when a client leaves the upgrades station.
- The client is sent back to some random info_player_teamspawn entity on the map (RED's spawn)
- This happens in a matter of 1-2 frames so assume it is impossible for a client to manually walk from the upgrades station to an info_player_teamspawn within that very tiny interval.

Is there a way to make sourcemod detect that an upgrade refund credit is used with this information?

Thanks!
Potato Uno is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 10-04-2015 , 10:13   Re: [TF2 MvM] Detect Upgrade Refund Usage
Reply With Quote #2

I know it doesn't involve your listed information, but just in case it helps this is the easiest way to detect the respec that I have found.
PHP Code:
public void OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("MVMResetPlayerUpgradeSpending"), MsgHook_MVMRespec);
}

public 
Action MsgHook_MVMRespec(UserMsg msg_idBfRead msg, const int[] playersint playersNumbool reliablebool init)
{
    
int client BfReadByte(msg); //client that used the respec    


Last edited by Tylerst; 10-04-2015 at 10:28.
Tylerst is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 10-04-2015 , 17:55   Re: [TF2 MvM] Detect Upgrade Refund Usage
Reply With Quote #3

Awesome, thank you very much!
Potato Uno 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 12:55.


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