Update base plugins for transitional syntax (#507)
This commit is contained in:
committed by
Nicholas Hastings
parent
e8734ccf28
commit
d9fb0ba64e
@@ -31,7 +31,7 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
DisplayVoteBanMenu(client, target)
|
||||
void DisplayVoteBanMenu(int client, int target)
|
||||
{
|
||||
g_voteClient[VOTE_CLIENTID] = target;
|
||||
g_voteClient[VOTE_USERID] = GetClientUserId(target);
|
||||
@@ -42,9 +42,9 @@ DisplayVoteBanMenu(client, target)
|
||||
LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target);
|
||||
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]);
|
||||
|
||||
g_voteType = voteType:ban;
|
||||
g_voteType = ban;
|
||||
|
||||
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
|
||||
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
|
||||
g_hVoteMenu.SetTitle("Voteban Player");
|
||||
g_hVoteMenu.AddItem(VOTE_YES, "Yes");
|
||||
g_hVoteMenu.AddItem(VOTE_NO, "No");
|
||||
@@ -52,11 +52,11 @@ DisplayVoteBanMenu(client, target)
|
||||
g_hVoteMenu.DisplayVoteToAll(20);
|
||||
}
|
||||
|
||||
DisplayBanTargetMenu(client)
|
||||
void DisplayBanTargetMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Ban);
|
||||
Menu menu = new Menu(MenuHandler_Ban);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Ban vote", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -66,12 +66,12 @@ DisplayBanTargetMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_VoteBan(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_VoteBan(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public AdminMenu_VoteBan(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Ban(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Ban(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -103,8 +103,8 @@ public MenuHandler_Ban(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32], String:name[32];
|
||||
new userid, target;
|
||||
char info[32], name[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info), _, name, sizeof(name));
|
||||
userid = StringToInt(info);
|
||||
@@ -125,7 +125,7 @@ public MenuHandler_Ban(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Voteban(client, args)
|
||||
public Action Command_Voteban(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -144,10 +144,10 @@ public Action:Command_Voteban(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:text[256], String:arg[64];
|
||||
char text[256], arg[64];
|
||||
GetCmdArgString(text, sizeof(text));
|
||||
|
||||
new len = BreakString(text, arg, sizeof(arg));
|
||||
int len = BreakString(text, arg, sizeof(arg));
|
||||
|
||||
if (len != -1)
|
||||
{
|
||||
@@ -158,8 +158,9 @@ public Action:Command_Voteban(client, args)
|
||||
g_voteArg[0] = '\0';
|
||||
}
|
||||
|
||||
decl String:target_name[MAX_TARGET_LENGTH];
|
||||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
||||
char target_name[MAX_TARGET_LENGTH];
|
||||
int target_list[MAXPLAYERS], target_count;
|
||||
bool tn_is_ml;
|
||||
|
||||
if ((target_count = ProcessTargetString(
|
||||
arg,
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
|
||||
DisplayVoteKickMenu(client, target)
|
||||
void DisplayVoteKickMenu(int client, int target)
|
||||
{
|
||||
g_voteClient[VOTE_CLIENTID] = target;
|
||||
g_voteClient[VOTE_USERID] = GetClientUserId(target);
|
||||
@@ -42,22 +41,21 @@ DisplayVoteKickMenu(client, target)
|
||||
LogAction(client, target, "\"%L\" initiated a kick vote against \"%L\"", client, target);
|
||||
ShowActivity(client, "%t", "Initiated Vote Kick", g_voteInfo[VOTE_NAME]);
|
||||
|
||||
g_voteType = voteType:kick;
|
||||
g_voteType = kick;
|
||||
|
||||
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
|
||||
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
|
||||
g_hVoteMenu.SetTitle("Votekick Player");
|
||||
g_hVoteMenu.AddItem(VOTE_YES, "Yes");
|
||||
g_hVoteMenu.AddItem(VOTE_NO, "No");
|
||||
g_hVoteMenu.ExitButton = false;
|
||||
g_hVoteMenu.DisplayVoteToAll(20);
|
||||
|
||||
}
|
||||
|
||||
DisplayKickTargetMenu(client)
|
||||
void DisplayKickTargetMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Kick);
|
||||
Menu menu = new Menu(MenuHandler_Kick);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Kick vote", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
@@ -67,12 +65,12 @@ DisplayKickTargetMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_VoteKick(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_VoteKick(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -89,7 +87,7 @@ public AdminMenu_VoteKick(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Kick(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Kick(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -104,8 +102,8 @@ public MenuHandler_Kick(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32], String:name[32];
|
||||
new userid, target;
|
||||
char info[32], name[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info), _, name, sizeof(name));
|
||||
userid = StringToInt(info);
|
||||
@@ -126,7 +124,7 @@ public MenuHandler_Kick(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Votekick(client, args)
|
||||
public Action Command_Votekick(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -145,12 +143,12 @@ public Action:Command_Votekick(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:text[256], String:arg[64];
|
||||
char text[256], arg[64];
|
||||
GetCmdArgString(text, sizeof(text));
|
||||
|
||||
new len = BreakString(text, arg, sizeof(arg));
|
||||
int len = BreakString(text, arg, sizeof(arg));
|
||||
|
||||
new target = FindTarget(client, arg);
|
||||
int target = FindTarget(client, arg);
|
||||
if (target == -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
|
||||
@@ -32,19 +32,19 @@
|
||||
*/
|
||||
|
||||
Menu g_MapList;
|
||||
new g_mapCount;
|
||||
int g_mapCount;
|
||||
|
||||
new Handle:g_SelectedMaps;
|
||||
new bool:g_VoteMapInUse;
|
||||
ArrayList g_SelectedMaps;
|
||||
bool g_VoteMapInUse;
|
||||
|
||||
DisplayVoteMapMenu(client, mapCount, String:maps[5][])
|
||||
void DisplayVoteMapMenu(int client, int mapCount, char[][] maps)
|
||||
{
|
||||
LogAction(client, -1, "\"%L\" initiated a map vote.", client);
|
||||
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map");
|
||||
|
||||
g_voteType = voteType:map;
|
||||
g_voteType = map;
|
||||
|
||||
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
|
||||
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
|
||||
|
||||
if (mapCount == 1)
|
||||
{
|
||||
@@ -59,9 +59,9 @@ DisplayVoteMapMenu(client, mapCount, String:maps[5][])
|
||||
g_voteInfo[VOTE_NAME][0] = '\0';
|
||||
|
||||
g_hVoteMenu.SetTitle("Map Vote");
|
||||
for (new i = 0; i < mapCount; i++)
|
||||
for (int i = 0; i < mapCount; i++)
|
||||
{
|
||||
decl String:displayName[PLATFORM_MAX_PATH];
|
||||
char displayName[PLATFORM_MAX_PATH];
|
||||
GetMapDisplayName(maps[i], displayName, sizeof(displayName));
|
||||
g_hVoteMenu.AddItem(maps[i], displayName);
|
||||
}
|
||||
@@ -71,29 +71,29 @@ DisplayVoteMapMenu(client, mapCount, String:maps[5][])
|
||||
g_hVoteMenu.DisplayVoteToAll(20);
|
||||
}
|
||||
|
||||
ResetMenu()
|
||||
void ResetMenu()
|
||||
{
|
||||
g_VoteMapInUse = false;
|
||||
ClearArray(g_SelectedMaps);
|
||||
g_SelectedMaps.Clear();
|
||||
}
|
||||
|
||||
ConfirmVote(client)
|
||||
void ConfirmVote(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Confirm);
|
||||
Menu menu = new Menu(MenuHandler_Confirm);
|
||||
|
||||
decl String:title[100];
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Confirm Vote", client);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
|
||||
decl String:itemtext[256];
|
||||
char itemtext[256];
|
||||
Format(itemtext, sizeof(itemtext), "%T", "Start the Vote", client);
|
||||
menu.AddItem("Confirm", itemtext);
|
||||
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -111,12 +111,12 @@ public MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:maps[5][PLATFORM_MAX_PATH];
|
||||
new selectedmaps = GetArraySize(g_SelectedMaps);
|
||||
char maps[5][PLATFORM_MAX_PATH];
|
||||
int selectedmaps = g_SelectedMaps.Length;
|
||||
|
||||
for (new i = 0; i < selectedmaps; i++)
|
||||
for (int i = 0; i < selectedmaps; i++)
|
||||
{
|
||||
GetArrayString(g_SelectedMaps, i, maps[i], sizeof(maps[]));
|
||||
g_SelectedMaps.GetString(i, maps[i], sizeof(maps[]));
|
||||
}
|
||||
|
||||
DisplayVoteMapMenu(param1, selectedmaps, maps);
|
||||
@@ -125,7 +125,7 @@ public MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_Cancel)
|
||||
{
|
||||
@@ -141,11 +141,11 @@ public MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_DrawItem)
|
||||
{
|
||||
decl String:info[32], String:name[32];
|
||||
char info[32], name[32];
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info), _, name, sizeof(name));
|
||||
|
||||
if (FindStringInArray(g_SelectedMaps, info) != -1)
|
||||
if (g_SelectedMaps.FindString(info) != -1)
|
||||
{
|
||||
return ITEMDRAW_IGNORE;
|
||||
}
|
||||
@@ -156,14 +156,14 @@ public MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32], String:name[32];
|
||||
char info[32], name[32];
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info), _, name, sizeof(name));
|
||||
|
||||
PushArrayString(g_SelectedMaps, info);
|
||||
g_SelectedMaps.PushString(info);
|
||||
|
||||
/* Redisplay the list */
|
||||
if (GetArraySize(g_SelectedMaps) < 5)
|
||||
if (g_SelectedMaps.Length < 5)
|
||||
{
|
||||
g_MapList.Display(param1, MENU_TIME_FOREVER);
|
||||
}
|
||||
@@ -174,20 +174,22 @@ public MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Display)
|
||||
{
|
||||
decl String:title[128];
|
||||
char title[128];
|
||||
Format(title, sizeof(title), "%T", "Please select a map", param1);
|
||||
SetPanelTitle(Handle:param2, title);
|
||||
|
||||
Panel panel = view_as<Panel>(param2);
|
||||
panel.SetTitle(title);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public AdminMenu_VoteMap(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_VoteMap(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -213,7 +215,7 @@ public AdminMenu_VoteMap(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Votemap(client, args)
|
||||
public Action Command_Votemap(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -232,12 +234,12 @@ public Action:Command_Votemap(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:text[256];
|
||||
char text[256];
|
||||
GetCmdArgString(text, sizeof(text));
|
||||
|
||||
decl String:maps[5][PLATFORM_MAX_PATH];
|
||||
new mapCount;
|
||||
new len, pos;
|
||||
char maps[5][PLATFORM_MAX_PATH];
|
||||
int mapCount;
|
||||
int len, pos;
|
||||
|
||||
while (pos != -1 && mapCount < 5)
|
||||
{
|
||||
@@ -262,12 +264,12 @@ public Action:Command_Votemap(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
new Handle:g_map_array = null;
|
||||
new g_map_serial = -1;
|
||||
Handle g_map_array = null;
|
||||
int g_map_serial = -1;
|
||||
|
||||
int LoadMapList(Menu menu)
|
||||
{
|
||||
new Handle:map_array;
|
||||
Handle map_array;
|
||||
|
||||
if ((map_array = ReadMapList(g_map_array,
|
||||
g_map_serial,
|
||||
@@ -283,14 +285,14 @@ int LoadMapList(Menu menu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
RemoveAllMenuItems(menu);
|
||||
menu.RemoveAllItems();
|
||||
|
||||
char map_name[PLATFORM_MAX_PATH];
|
||||
new map_count = GetArraySize(g_map_array);
|
||||
int map_count = GetArraySize(g_map_array);
|
||||
|
||||
for (new i = 0; i < map_count; i++)
|
||||
for (int i = 0; i < map_count; i++)
|
||||
{
|
||||
decl String:displayName[PLATFORM_MAX_PATH];
|
||||
char displayName[PLATFORM_MAX_PATH];
|
||||
GetArrayString(g_map_array, i, map_name, sizeof(map_name));
|
||||
GetMapDisplayName(map_name, displayName, sizeof(displayName));
|
||||
menu.AddItem(map_name, displayName);
|
||||
|
||||
Reference in New Issue
Block a user