Okay, so there are two other plugins that do kinda the same thing as this one, but not really. I'll explain in this thread the differences
This plugin will keep track of player's cash when they join spectate, or disconnect, and ensure that when they join back to a team, they have the same cash they left with (on a per map basis only, map change will reset their cash to default).
How this works is if they join spectate with less money than mp_startmoney, or simply disconnect and reconnect before the map changes, this plugin will reapply the amount of money the had before leaving the team. This is to thwart what is knows as, "spectate hopping" to increase their cash when they fall below mp_startmoney.
If mp_startmoney is 1000, and the player has 300 when they enter spectate, after they join back to a team and spawn, their money will be changed back to 300. If a player joins spectate with more cash than mp_startmoney, this plugin will leave their cash alone.
If a player disconnects (for whatever reason), if they reconnect before the map changes, their cash will be restored to what it was when they disconnected.
Messages are displayed to the players when they enter spectate and when they join back to a team - you can modify it a bit in the translations file, just keep the format the same.
[SpecHopCash] When you join your team again, your cash will be restored to $<amount>
[SpecHopCash] Your cash has been restored to $<amount>
How this plugin differs from ^BuGs^ Disable Spec For Cash
is his plugin has been reported as not working, and he hasn't been showing that he's still supporting that plugin
. Also, his plugin would just subtract the entire mp_startmoney amount from a player after they joined spectate and back.
How this plugin differs from FlyingMongoose's Spectate Hop For Money Prevention
is that his plugin hard sets the player's cash in such a way that team money is not given to a player when they spawn. Example: When a player goes into spectate with 300, and then back into a team, when they spawn, their money is set to 300 and the player doesn't get the amount of money given to the team at the beginning of the round like every other player gets. Reported here
. Also, his plugin was giving timer errors.
So, this is why I am publishing this plugin. It is basically a combo of the above two plugins without options. It simply restores a player's cash when they join spectate and go back to a team. I've tested this as best I can and am 98% sure it will work w/o issue, but please reply if you discover any issues and I'll jump on it as soon as I can.
Thank you guys for the basic ideas and help to make this a better plugin
Also, there is a plugin called Save Scores
that will save a players scores as well as their cash amount. If you're looking for that additional functionality, you might want to take a look at that one.
- Initial release
Version 1.1 - 1.3
- Internal changes including translation file, cleaner code, and use of array.
- Fixed the retrieval of saved cash amount from array and annotated code a bit.
- Added translation file
- Removed handle for timer, not needed (thanks for suggestion databomb)
- Changed from using array's to using a Trie - thanks for the heads up on that KyleS - it's a better suited data structure
- Fixed possible bug where player could retain cash across map changes.
- Download the plugin and translation file. Place the NoSpecHopCash.smx into your sourcemod plugins folder - place the NoSPecHopCash.phrases.txt in your sourcemod translations folder