Thread: [Solved] Doesn't return a value
View Single Post
Author Message
Lmfao
Junior Member
Join Date: Oct 2011
Old 01-17-2022 , 14:28   Doesn't return a value
Reply With Quote #1

Hi.
I don't understand why Handler_VoteCallback doesn't return a value.
Any idea?
No error in compilation.
I only got this error
Code:
L 01/17/2022 - 20:14:40: [SM] Call stack trace:
L 01/17/2022 - 20:14:40: [SM]   [0] VFormat
L 01/17/2022 - 20:14:40: [SM]   [1] Line 94, C:\Users\User\Docs\dev\addons\sourcemod\scripting\include\multicolors.inc::CPrintToChatAll
L 01/17/2022 - 20:14:40: [SM]   [2] Line 179, testvote.sp::Handler_VoteCallback
L 01/17/2022 - 20:14:40: [SM] Exception reported: Language phrase "{default}Vote Successful" not found (arg 3)
L 01/17/2022 - 20:14:34: [SM] Exception reported: Language phrase "{default}}No Votes Cast" not found (arg 3)
L 01/17/2022 - 20:11:34: [SM] Exception reported: Language phrase "{default}Vote Failed" not found (arg 3)
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <multicolors>

#define PLUGIN_VERSION "1.0"
#define VOTE_NO "###no###"
#define VOTE_YES "###yes###"

ConVar g_CVar_mp_timeround;

public 
Plugin:myinfo =
{
    
name "test",
    
author "test",
    
description "test plugin",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_fmptimeround"Command_ForceTimeroundADMFLAG_CONVARS"Force Forcetimeround Enable 1/0");
    
g_CVar_mp_timeround FindConVar("mp_timeround");
}
public 
int Handler_VoteCallback(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
    else if (
action == MenuAction_DisplayItem)
    {
        
char display[64];
        
menu.GetItem(param2""0_displaysizeof(display));

         if (
strcmp(displayVOTE_NO) == || strcmp(displayVOTE_YES) == 0)
         {
            
char buffer[255];
            
Format(buffersizeof(buffer), "%T"displayparam1);

            return 
RedrawMenuItem(buffer);
        }
    }
    else if (
action == MenuAction_VoteCancel && param1 == VoteCancel_NoVotes)
    {
        
CPrintToChatAll("{green}[SM] %t""{default}}No Votes Cast");
    } 

Last edited by Lmfao; 01-18-2022 at 13:41. Reason: Solved
Lmfao is offline