"Votes"
{
"Stab Stab Zap"
{
"ratio" "0.60"
"text" "" // Default: "{VOTER_NAME} has voted to {TRIGGER} ({VOTE_AMOUNT} votes / {VOTE_REQUIRED} needed)"
"passtext" "" // Default: "Vote to {TRIGGER} has passed"
"duration" "-1" // default to unlimited
"cooldown" "-1" // default to no cooldown
"trigger" "votestabstabzap"
"command" "exec custom/foo/bar.cfg; bot_kick; bot_quota 10"
}
"Mute Player"
{
"ratio" "0.60"
"text" "{VOTER_NAME} has voted to mute {TARGET_NAME} ({VOTE_AMOUNT} votes / {VOTE_REQUIRED} needed)"
"passtext" "Vote to mute {TARGET_NAME} has passed"
"duration" "120" // seconds
"cooldown" "240" // seconds
"trigger" "votemute %t" // Require %t from each
"command" "sm_silence #{TARGET_ID}"
}
}
Watch chat for !trigger and /trigger
Don't print vote to chat on / silent command
When enough players have typed the trigger, run the command block
After running the command(s), disallow votes for that trigger until $cooldown expires
Accept a sourcemod target as %t - #id, @all, etc
String sub in output text
Variable names / substitution method can be changed, just ^c^v'ing how the old plugin does it
Dynamically recalculate num votes needed based on changing user count
But don't exec the command if required drops below received because of this
Require one more vote in this case
Example of user interaction
> goos: !votestabstabzap
>> goos has voted to votestabstabzap (1 votes / 2 needed)
> eggs: !votestabstabzap
>> goos has voted to votestabstabzap (2 votes / 2 needed)
>> Vote to votestabstabzap has passed
>>> exec custom/foo/bar.cfg; bot_kick; bot_quota 10;
> goos: !votemute eggs
>> goos has voted to mute Eggs with Legs (1 votes / 3 needed)
> m3: !votemute eggs
>> goos has voted to mute Eggs with Legs (2 votes / 3 needed)
> sue: !votemute 241
>> sue has voted to mute Eggs with Legs (3 votes / 3 needed)
>> Vote to mute Eggs with Legs has passed
>>> sm_silence #{TARGET_ID} // sm_silence #241
sm_customvotes
!trigger
and/trigger
/
silent command%t
-#id
,@all
, etcExample of user interaction