Raised This Month: $ Target: $400
 0% 

[TF2][REQ] Anti vote spam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tike
Junior Member
Join Date: Apr 2014
Old 04-23-2014 , 14:28   [TF2][REQ] Anti vote spam
Reply With Quote #1

Hi,

Is there some plugin that makes it so you can't spam map vote changes i.e. one has to play 3 rounds on the map till a new vote can be made.

Thanks,
Tike
Tike is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-23-2014 , 15:13   Re: [TF2][REQ] Anti vote spam
Reply With Quote #2

By 3 rounds, do you mean any 3 rounds or did you mean 3 map resets (i.e. going all the way through a multi-round map before it counts as one round)?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Tike
Junior Member
Join Date: Apr 2014
Old 04-23-2014 , 15:32   Re: [TF2][REQ] Anti vote spam
Reply With Quote #3

3 Map resets, sorry if I didn't give alot or enough info. Or even just something customizable.

Last edited by Tike; 04-23-2014 at 15:33.
Tike is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-23-2014 , 16:04   Re: [TF2][REQ] Anti vote spam
Reply With Quote #4

This doesn't block the NextLevel vote, but it does block the ChangeLevel vote until (by default) round 4.

Edit 2: Now blocks both votes.

It should auto-create a config file cfg/sourcemod/votedelay_changelevel.cfg.

This should work in both TF2 and CS:GO.

A lot of the code for this is lifted from my NativeVotes plugin, specifically from version 1.0.0 beta 4.

(btw, I assumed you meant the built-in game votes as opposed to rtv and the like).

This depends on sdktools in order to detect if we're in Warmup mode on CS:GO.

Edit: Actually, this should also block the NextLevel vote because Valve made it so that if the nextlevel cvar is set, it will change maps as soon as the current round ends... give me a sec.

Edit 2: Updated.
Attached Files
File Type: sp Get Plugin or Get Source (votedelay_changelevel.sp - 299 views - 7.3 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-23-2014 at 16:24.
Powerlord is offline
Tike
Junior Member
Join Date: Apr 2014
Old 04-24-2014 , 11:15   Re: [TF2][REQ] Anti vote spam
Reply With Quote #5

I seem to have a problem. I can still vote for new maps right after the map changed. Thanks alot for now though. I really appreciate your help

Last edited by Tike; 04-24-2014 at 11:16.
Tike is offline
Tike
Junior Member
Join Date: Apr 2014
Old 04-30-2014 , 10:49   Re: [TF2][REQ] Anti vote spam
Reply With Quote #6

How exactly is it supposed to work if I may ask?
Tike is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-30-2014 , 15:03   Re: [TF2][REQ] Anti vote spam
Reply With Quote #7

Whoops, I forgot about this.

Wow, I feel dumb. I was just looking for the code to answer your previous question and I noticed I hooked the "vote" command instead of the "callvote" command.*

Try this instead.

Anyway, the general logic of the plugin:
  • The plugin keeps a counter of what round it is. This is incremented when a round ends... unless votedelay_changelevel_fullrounds is true and the event's "full_round" value is false.
  • The counter resets to 1 on map change (remember: This counter is only incremented when the round ends)
  • The callvote command checks for ChangeLevel and NextLevel votes. If it IS one of those votes and the current round is >= votedelay_changelevel_rounds, it returns the "vote is disabled" message and prints to their chat window why it's disabled.
If I were to turn this into a full plugin, I'd probably want to change that into a translation phrase.


* Part of the reason I feel stupid is that I'm the person who documented how the TF2 vote system works internally and wrote the NativeVotes plugin based on my findings. NativeVotes exposes a SourcePawn interface for the vote system to SourceMod plugins. Version 1.0.0 beta 4 even handles the callvote interface and allows plugins to register votes that can appear in it.

The next version of both Nominations Extended and RockTheVote Extended actually hook some of these by default if the next version of NativeVotes is loaded. Nominations Extended hooks NextLevel and ChangeLevel, while RockTheVote Extended hooks ChangeLevel and RockTheVote.
Attached Files
File Type: sp Get Plugin or Get Source (votedelay_changelevel.sp - 334 views - 7.3 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-30-2014 at 15:22.
Powerlord is offline
Tike
Junior Member
Join Date: Apr 2014
Old 05-07-2014 , 12:55   Re: [TF2][REQ] Anti vote spam
Reply With Quote #8

Thanks for doing all this hassle, I'm testing it at the moment.

Last edited by Tike; 05-07-2014 at 13:00.
Tike is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2014 , 13:01   Re: [TF2][REQ] Anti vote spam
Reply With Quote #9

Quote:
Originally Posted by Tike View Post
I keep getting this error in my console


Any ideas?
Well, the error is missing from that message (it's one more line up), but I can tell what the error is... I apparently copied the name of the L4D/L4D2 property instead of the TF2/CSGO one.

So, here's another version.
Attached Files
File Type: sp Get Plugin or Get Source (votedelay_changelevel.sp - 265 views - 7.4 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2014 at 13:03.
Powerlord 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 20:49.


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