Raised This Month: $114 Target: $400
 28% 

Solved [TF2 MvM] Refund all upgrades on a client?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 04-04-2019 , 07:20   [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #1

Can I refund all upgrades on a specific client with sourcepawn? This could be used like '/refundall @me' or '/refundall John'.

Thanks! -Theon32

Last edited by Theon32; 04-09-2019 at 18:20.
Theon32 is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 04-04-2019 , 09:18   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #2

Quote:
Originally Posted by Theon32 View Post
Can I refund all upgrades on a specific client with sourcepawn? This could be used like '/refundall @me' or '/refundall John'.

Thanks! -Theon32
I have no idea what you mean by upgrades. Can you explain what exactly you want to do or what you want to achieve?
__________________
impossible_cc is offline
adma
Senior Member
Join Date: Oct 2015
Old 04-04-2019 , 09:36   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #3

Now, im not sure about this but there is a user message called MVMResetPlayerUpgradeSpending. It is sent when a player refunds. You should probably hook that usermsg and try figure out what gets written in what order (i.e. client index, weapon id(?)). Once you figure that out, you can simulate it by creating a user message then filling it with the appropriate data. Hope this points you in the right direction
__________________
adma is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 04-04-2019 , 09:43   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #4

m_bInUpgradeZone 1
FakeClientCommandKeyValues "MVM_Respec"
m_bInUpgradeZone 0
__________________
Pelipoika is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-04-2019 , 10:03   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #5

Players have been able to refund upgrades on their own for years now when they're in the upgrade shop, what's the use case for this?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 04-04-2019 , 10:36   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #6

I was using '/refundall' as an example. The main purpose I want to use this for is to refund upgrades on a player if they change team, change class, or disconnect to prevent 'buffer overflow' for infinite money servers (like mine). Most people would probably just say not to make it an infinite money server, but it feels less fun without it. I already have the hookevents in place to detect when the three issues have occurred, I just need a way to refund all upgrades automatically.
Theon32 is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 04-04-2019 , 14:44   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #7

Quote:
Originally Posted by Pelipoika View Post
m_bInUpgradeZone 1
FakeClientCommandKeyValues "MVM_Respec"
m_bInUpgradeZone 0
Sorry but how do I execute this on a client? (I'm a bit new to sourcepawn and php)
Theon32 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-04-2019 , 16:35   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #8

Something like this:

PHP Code:
KeyValues respec = new KeyValues("MVM_Respec");

bool inUpgradeZone GetEntProp(clientProp_Send"m_bInUpgradeZone");

if (!
inUpgradeZone)
    
SetEntProp(clientProp_Send"m_bInUpgradeZone"1);

FakeClientCommandKeyValues(clientrespec);

if (!
inUpgradeZone)
    
SetEntProp(clientProp_Send"m_bInUpgradeZone"0);

delete respec
Note: I didn't test if it actually worked or not.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-04-2019 at 16:35.
Powerlord is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 04-04-2019 , 20:22   Re: [TF2 MvM] Refund all upgrades on a client?
Reply With Quote #9

Thank you so much! There is one bug though that sometimes you respawn and the menu is still open, but I simply fixed that by setting up a timer that activates in a couple of seconds then tries to close the menu again.
Theon32 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 00:08.


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