sourcemod/plugins/basecommands/cancelvote.sp
David Anderson 04b2845b0d - improved comments on ShowActivity() natives
- switched to ShowActivity2() in basecommands
- added lifestates offsets to core gamedata file
- added a few translation phrases that were missing
- added new API calls to IPlayerHelpers for extending target processing

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401629
2007-10-21 20:35:15 +00:00

44 lines
844 B
SourcePawn

PerformCancelVote(client)
{
if (!IsVoteInProgress())
{
ReplyToCommand(client, "[SM] %t", "Vote Not In Progress");
return;
}
ShowActivity2(client, "[SM] ", "%t", "Cancelled Vote");
CancelVote();
}
public AdminMenu_CancelVote(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
Format(buffer, maxlength, "%T", "Cancel vote", param);
}
else if (action == TopMenuAction_SelectOption)
{
PerformCancelVote(param);
RedisplayAdminMenu(topmenu, param);
}
else if (action == TopMenuAction_DrawOption)
{
buffer[0] = IsVoteInProgress() ? ITEMDRAW_DEFAULT : ITEMDRAW_IGNORE;
}
}
public Action:Command_CancelVote(client, args)
{
PerformCancelVote(client);
return Plugin_Handled;
}