caxanga334 / cvreduxmodified

Modified version of ReFlexPoison's custom votes
GNU General Public License v3.0
15 stars 9 forks source link

Not logging vote progress in chat with simple type #2

Closed yarik2720 closed 6 years ago

yarik2720 commented 6 years ago

I have simple vote in customevotes.cfg:

"Custom Votes"
{
    "Reload Map"
    {
        "type"          "simple"
        "vote"          "1"
        "ratio"         "0.7"
        "minimum"       "1"
        "command"       "sm_reloadmap"
        "delay"         "60"
        "cooldown"      "300"
        "start_notify"  "{olive}[Synergy] {default}{VOTER_NAME} started vote for map RESTART!"
        "call_notify"   "{olive}[Synergy] {default}Vote cast for {yes|no}."
        "pass_notify"   "{olive}[Synergy] {default}Vote passed, RESTARTING!"
        "fail_notify"   "{olive}[Synergy] {default}Vote failed. Received: {VOTE_AMOUNT} Required: {VOTE_REQUIRED}"
    }
....................

It works, votes passes well, but when players make vote it doesn't result in chat. In error log I see this:

L 08/31/2018 - 23:39:25: [SM] Exception reported: Invalid convar handle 0 (error 4)
L 08/31/2018 - 23:39:25: [SM] Blaming: customvotes.smx
L 08/31/2018 - 23:39:25: [SM] Call stack trace:
L 08/31/2018 - 23:39:25: [SM]   [0] GetConVarBool
L 08/31/2018 - 23:39:25: [SM]   [1] Line 1721, C:\Users\gusta\Documents\public_plugins\compiler\customvotes.sp::VoteHandler_Simple
L 08/31/2018 - 23:39:26: [SM] Exception reported: Invalid convar handle 0 (error 4)
L 08/31/2018 - 23:39:26: [SM] Blaming: customvotes.smx
L 08/31/2018 - 23:39:26: [SM] Call stack trace:
L 08/31/2018 - 23:39:26: [SM]   [0] GetConVarBool
L 08/31/2018 - 23:39:26: [SM]   [1] Line 1749, C:\Users\gusta\Documents\public_plugins\compiler\customvotes.sp::VoteHandler_Simple
yarik2720 commented 6 years ago

with type list it is not working at all:

L 09/01/2018 - 00:07:26: [SM] Exception reported: Invalid Handle 0 (error: 4)
L 09/01/2018 - 00:07:26: [SM] Blaming: customvotes.smx
L 09/01/2018 - 00:07:26: [SM] Call stack trace:
L 09/01/2018 - 00:07:26: [SM]   [0] GetArraySize
L 09/01/2018 - 00:07:26: [SM]   [1] Line 1245, C:\Users\gusta\Documents\public_plugins\compiler\customvotes.sp::Menu_ListVote
L 09/01/2018 - 00:07:26: [SM]   [2] Line 445, C:\Users\gusta\Documents\public_plugins\compiler\customvotes.sp::MenuHandler_Vote
caxanga334 commented 6 years ago

I've updated the plugin, it worked fine on my local test server, please confirm if the fix is working. Edit: use simple in vote type.

Vote config used for testing: (tested in TF2)

"Toggle Friendly Fire"
{
    "type"          "simple"
    "vote"          "1"
    "minimum"       "1"
    "command"       "sm_voteff"
    "start_notify"  "[SM] {VOTER_NAME} ({VOTER_STEAMID}) started a vote to toggle friendly fire."
    "call_notify"   "[SM] {VOTER_NAME} voted for {yes|no}."
    "pass_notify"   "[SM] Vote passed."
    "fail_notify"   "[SM] Vote failed. Received: {VOTE_AMOUNT} Required: {VOTE_REQUIRED}"
    "chattrigger"   "votemaptime"
}
yarik2720 commented 6 years ago

Fix works, thanks!