Veteran Member
Join Date: May 2012
Location: Homeless
|
12-12-2017
, 00:05
Exception reported: A vote is already in progress
|
#1
|
Hey guys, I'm getting the following errors whenever I use a command to open a vote menu while another vote menu is already open.
Error:
Code:
L 12/11/2017 - 20:50:36: [SM] Exception reported: A vote is already in progress
L 12/11/2017 - 20:50:36: [SM] Blaming: l4d_anti-speedrunner.smx
L 12/11/2017 - 20:50:36: [SM] Call stack trace:
L 12/11/2017 - 20:50:36: [SM] [0] VoteMenu
L 12/11/2017 - 20:50:36: [SM] [1] Line 584, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_anti-speedrunner.sp::Command_Chase
L 12/11/2017 - 20:51:20: [SM] Exception reported: A vote is already in progress
L 12/11/2017 - 20:51:20: [SM] Blaming: l4d_anti-speedrunner.smx
L 12/11/2017 - 20:51:20: [SM] Call stack trace:
L 12/11/2017 - 20:51:20: [SM] [0] VoteMenu
L 12/11/2017 - 20:51:20: [SM] [1] Line 639, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d_anti-speedrunner.sp::Command_Warp
My menu code:
PHP Code:
char GlobalBuffer[512];
public Action Command_Chase(int client, int args)
{
if(!l4d_ass_enable.BoolValue || !l4d_ass_punish_enable.BoolValue || !l4d_ass_punish_vote.BoolValue || l4d_ass_punish_auto.BoolValue || NumTanks2)
return Plugin_Handled;
if(!l4d_ass_punish_tank.BoolValue)
CountTanks();
tmenuStarted = false;
if(l4d_ass_punish_vote.BoolValue)
{
for(int i = 1; i <= MaxClients; i++)
{
if(!IsValidClient(i))
continue;
humanPlayers[totalHumans++] = i;
}
for(int i = 1; i <= MaxClients; i++)
{
if(!pmenuStarted && IsValidClient(i))
{
pmenuStarted = true;
Menu chooseMenu = CreateMenu(chooseMenuHandler);
SetVoteResultCallback(chooseMenu, chooseMenuResults);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "PunishSpeedrunners", i);
chooseMenu.SetTitle(GlobalBuffer);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "YesOption", i);
chooseMenu.AddItem("Yes", GlobalBuffer);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "NoOption", i);
chooseMenu.AddItem("No", GlobalBuffer);
SetMenuPagination(chooseMenu, MENU_NO_PAGINATION);
VoteMenu(chooseMenu, humanPlayers, totalHumans, 30);
}
else
{
if(tmenuStarted)
{
if(IsValidClient(i))
ReplyToCommand(i, "\x04[ASS]\x01 %T", "TeleportMenuOn", i);
return Plugin_Handled;
}
else if(pmenuStarted)
{
if(IsValidClient(i))
ReplyToCommand(i, "\x04[ASS]\x01 %T", "PunishMenuOn", i);
return Plugin_Handled;
}
}
}
}
return Plugin_Continue;
}
public Action Command_Warp(int client, int args)
{
if(!l4d_ass_enable.BoolValue || !l4d_ass_teleport_enable.BoolValue || !l4d_ass_teleport_vote.BoolValue || l4d_ass_teleport_auto.BoolValue || NumTanks3)
return Plugin_Handled;
if(!l4d_ass_teleport_tank.BoolValue)
CountTanks();
pmenuStarted = false;
if(l4d_ass_teleport_vote.BoolValue)
{
for(int i = 1; i <= MaxClients; i++)
{
if(!IsValidClient(i))
continue;
humanPlayers[totalHumans++] = i;
}
for(int i = 1; i <= MaxClients; i++)
{
if(!tmenuStarted && IsValidClient(i))
{
tmenuStarted = true;
Menu chooseMenu2 = CreateMenu(chooseMenuHandler2);
SetVoteResultCallback(chooseMenu2, chooseMenuResults2);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "TeleportSpeedrunners", i);
chooseMenu2.SetTitle(GlobalBuffer);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "YesOption", i);
chooseMenu2.AddItem("Yes", GlobalBuffer);
Format(GlobalBuffer, sizeof(GlobalBuffer), "%T", "NoOption", i);
chooseMenu2.AddItem("No", GlobalBuffer);
SetMenuPagination(chooseMenu2, MENU_NO_PAGINATION);
VoteMenu(chooseMenu2, humanPlayers, totalHumans, 30);
}
else
{
if(pmenuStarted)
{
if(IsValidClient(i))
ReplyToCommand(i, "\x04[ASS]\x01 %T", "PunishMenuOn", i);
return Plugin_Handled;
}
else if(tmenuStarted)
{
if(IsValidClient(i))
ReplyToCommand(i, "\x04[ASS]\x01 %T", "TeleportMenuOn", i);
return Plugin_Handled;
}
}
}
}
return Plugin_Handled;
}
public int chooseMenuHandler(Menu menu, MenuAction action, int param1, int param2)
{
if(l4d_ass_punish_vote.BoolValue && !l4d_ass_punish_auto.BoolValue)
{
switch(action)
{
case MenuAction_Select:
{
GetMenuItem(menu, param2, GlobalBuffer, sizeof(GlobalBuffer));
switch(StringToInt(GlobalBuffer))
{
case 0: pvotedYes += 1;
case 1: pvotedNo += 1;
}
}
case MenuAction_End:
delete menu;
}
}
}
public int chooseMenuHandler2(Menu menu, MenuAction action, int param1, int param2)
{
if(l4d_ass_teleport_vote.BoolValue && !l4d_ass_teleport_auto.BoolValue)
{
switch(action)
{
case MenuAction_Select:
{
GetMenuItem(menu, param2, GlobalBuffer, sizeof(GlobalBuffer));
switch(StringToInt(GlobalBuffer))
{
case 0: tvotedYes += 1;
case 1: tvotedNo += 1;
}
}
case MenuAction_End:
delete menu;
}
}
}
public void chooseMenuResults(Handle menu, int pnum_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info)
{
if(!l4d_ass_enable.BoolValue || !l4d_ass_punish_enable.BoolValue || !l4d_ass_punish_vote.BoolValue || l4d_ass_punish_auto.BoolValue || NumTanks2)
return;
if(!l4d_ass_punish_tank.BoolValue)
CountTanks();
pnum_votes = pvotedYes + pvotedNo;
if(pnum_votes < GetHumanCount())
pvotedUnknown = GetHumanCount() - pnum_votes;
if(pvotedUnknown > pnum_votes)
{
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "NoVotes", i);
}
else
{
if(pvotedYes > pvotedNo)
{
int add = GetConVarInt(l4d_ass_punish_timer);
CreateTimer(0.1, TimerUpdatePlayer, GetEngineTime() + add, TIMER_REPEAT);
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "VotedYes", i);
}
else if(pvotedNo > pvotedYes)
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "VotedNo", i);
}
pmenuStarted = false;
pvotedYes = 0;
pvotedNo = 0;
return;
}
public void chooseMenuResults2(Handle menu, int tnum_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info)
{
if(!l4d_ass_enable.BoolValue || !l4d_ass_teleport_enable.BoolValue || !l4d_ass_teleport_vote.BoolValue || l4d_ass_teleport_auto.BoolValue || NumTanks3)
return;
if(!l4d_ass_teleport_tank.BoolValue)
CountTanks();
tnum_votes = tvotedYes + tvotedNo;
if(tnum_votes < GetHumanCount())
tvotedUnknown = GetHumanCount() - tnum_votes;
if(tvotedUnknown > tnum_votes)
{
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "NoVotes", i);
}
else
{
if(tvotedYes > tvotedNo)
{
int add = GetConVarInt(l4d_ass_teleport_timer);
CreateTimer(0.1, TimerCheckForSpeedrunners, GetEngineTime() + add, TIMER_REPEAT);
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "VotedYes", i);
}
else if(tvotedNo > tvotedYes)
for(int i = 1; i <= MaxClients; i++)
if(IsValidClient(i))
PrintToChatAll("\x04[ASS]\x01 %T", "VotedNo", i);
}
tmenuStarted = false;
tvotedYes = 0;
tvotedNo = 0;
return;
}
__________________
Last edited by Psyk0tik; 12-12-2017 at 06:47.
Reason: Marked as [Solved]
|
|