1 DisplayVoteFFMenu(client)
3 if (IsVoteInProgress())
5 ReplyToCommand(client, "[SM] %t", "Vote in Progress");
9 if (!TestVoteDelay(client))
14 LogAction(client, -1, "\"%L\" initiated a friendly fire vote.", client);
15 ShowActivity2(client, "[SM] ", "%t", "Initiated Vote FF");
17 g_voteType = voteType:ff;
18 g_voteInfo[VOTE_NAME][0] = '\0';
20 g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
22 if (GetConVarBool(g_Cvar_Alltalk))
24 SetMenuTitle(g_hVoteMenu, "Voteff Off");
28 SetMenuTitle(g_hVoteMenu, "Voteff On");
31 AddMenuItem(g_hVoteMenu, VOTE_YES, "Yes");
32 AddMenuItem(g_hVoteMenu, VOTE_NO, "No");
33 SetMenuExitButton(g_hVoteMenu, false);
34 VoteMenuToAll(g_hVoteMenu, 20);
37 public AdminMenu_VoteFF(Handle:topmenu,
39 TopMenuObject:object_id,
44 if (action == TopMenuAction_DisplayOption)
46 Format(buffer, maxlength, "%T", "Vote FF", param);
48 else if (action == TopMenuAction_SelectOption)
50 DisplayVoteFFMenu(param);
52 else if (action == TopMenuAction_DrawOption)
54 /* disable this option if a vote is already running */
55 buffer[0] = !IsNewVoteAllowed() ? ITEMDRAW_IGNORE : ITEMDRAW_DEFAULT;
59 public Action:Command_VoteFF(client, args)
63 ReplyToCommand(client, "[SM] Usage: sm_voteff");
64 return Plugin_Handled;
67 DisplayVoteFFMenu(client);
69 return Plugin_Handled;