Update plugins for transitional methods.
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new Handle:g_ConfigMenu = INVALID_HANDLE;
|
||||
Menu g_ConfigMenu = null;
|
||||
|
||||
PerformExec(client, String:path[])
|
||||
{
|
||||
@@ -61,11 +61,11 @@ public AdminMenu_ExecCFG(Handle:topmenu,
|
||||
}
|
||||
else if (action == TopMenuAction_SelectOption)
|
||||
{
|
||||
DisplayMenu(g_ConfigMenu, param, MENU_TIME_FOREVER);
|
||||
g_ConfigMenu.Display(param, MENU_TIME_FOREVER);
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_ExecCFG(Handle:menu, MenuAction:action, param1, param2)
|
||||
public MenuHandler_ExecCFG(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_Cancel)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public MenuHandler_ExecCFG(Handle:menu, MenuAction:action, param1, param2)
|
||||
{
|
||||
decl String:path[256];
|
||||
|
||||
GetMenuItem(menu, param2, path, sizeof(path));
|
||||
menu.GetItem(param2, path, sizeof(path));
|
||||
|
||||
PerformExec(param1, path);
|
||||
}
|
||||
@@ -116,14 +116,14 @@ ParseConfigs()
|
||||
config_parser.OnLeaveSection = EndSection;
|
||||
config_parser.OnKeyValue = KeyValue;
|
||||
|
||||
if (g_ConfigMenu != INVALID_HANDLE)
|
||||
if (g_ConfigMenu != null)
|
||||
{
|
||||
CloseHandle(g_ConfigMenu);
|
||||
delete g_ConfigMenu;
|
||||
}
|
||||
|
||||
g_ConfigMenu = CreateMenu(MenuHandler_ExecCFG, MenuAction_Display);
|
||||
SetMenuTitle(g_ConfigMenu, "%T", "Choose Config", LANG_SERVER);
|
||||
SetMenuExitBackButton(g_ConfigMenu, true);
|
||||
g_ConfigMenu.SetTitle("%T", "Choose Config", LANG_SERVER);
|
||||
g_ConfigMenu.ExitBackButton = true;
|
||||
|
||||
decl String:configPath[256];
|
||||
BuildPath(Path_SM, configPath, sizeof(configPath), "configs/adminmenu_cfgs.txt");
|
||||
@@ -155,7 +155,7 @@ public SMCResult NewSection(SMCParser smc, const char[] name, bool opt_quotes)
|
||||
|
||||
public SMCResult KeyValue(SMCParser smc, const char[] key, const char[] value, bool key_quotes, bool value_quotes)
|
||||
{
|
||||
AddMenuItem(g_ConfigMenu, key, value);
|
||||
g_ConfigMenu.AddItem(key, value);
|
||||
}
|
||||
|
||||
public SMCResult EndSection(SMCParser smc)
|
||||
|
||||
@@ -47,16 +47,16 @@ PerformKick(client, target, const String:reason[])
|
||||
|
||||
DisplayKickMenu(client)
|
||||
{
|
||||
new Handle:menu = CreateMenu(MenuHandler_Kick);
|
||||
Menu menu = CreateMenu(MenuHandler_Kick);
|
||||
|
||||
decl String:title[100];
|
||||
Format(title, sizeof(title), "%T:", "Kick player", client);
|
||||
SetMenuTitle(menu, title);
|
||||
SetMenuExitBackButton(menu, true);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
|
||||
AddTargetsToMenu(menu, client, false, false);
|
||||
|
||||
DisplayMenu(menu, client, MENU_TIME_FOREVER);
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_Kick(Handle:topmenu,
|
||||
@@ -76,11 +76,11 @@ public AdminMenu_Kick(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Kick(Handle:menu, MenuAction:action, param1, param2)
|
||||
public MenuHandler_Kick(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
CloseHandle(menu);
|
||||
delete menu;
|
||||
}
|
||||
else if (action == MenuAction_Cancel)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public MenuHandler_Kick(Handle:menu, MenuAction:action, param1, param2)
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
|
||||
GetMenuItem(menu, param2, info, sizeof(info));
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
|
||||
if ((target = GetClientOfUserId(userid)) == 0)
|
||||
|
||||
+11
-11
@@ -31,7 +31,7 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
public MenuHandler_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
|
||||
public MenuHandler_ChangeMap(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_Cancel)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ public MenuHandler_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
|
||||
{
|
||||
decl String:map[64];
|
||||
|
||||
GetMenuItem(menu, param2, map, sizeof(map));
|
||||
menu.GetItem(param2, map, sizeof(map));
|
||||
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Changing map", map);
|
||||
|
||||
@@ -75,7 +75,7 @@ public AdminMenu_Map(Handle:topmenu,
|
||||
}
|
||||
else if (action == TopMenuAction_SelectOption)
|
||||
{
|
||||
DisplayMenu(g_MapList, param, MENU_TIME_FOREVER);
|
||||
g_MapList.Display(param, MENU_TIME_FOREVER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,10 +119,10 @@ public Action:Timer_ChangeMap(Handle:timer, Handle:dp)
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
new Handle:g_map_array = INVALID_HANDLE;
|
||||
new Handle:g_map_array = null;
|
||||
new g_map_serial = -1;
|
||||
|
||||
LoadMapList(Handle:menu)
|
||||
int LoadMapList(Menu menu)
|
||||
{
|
||||
new Handle:map_array;
|
||||
|
||||
@@ -130,25 +130,25 @@ LoadMapList(Handle:menu)
|
||||
g_map_serial,
|
||||
"sm_map menu",
|
||||
MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT|MAPLIST_FLAG_MAPSFOLDER))
|
||||
!= INVALID_HANDLE)
|
||||
!= null)
|
||||
{
|
||||
g_map_array = map_array;
|
||||
}
|
||||
|
||||
if (g_map_array == INVALID_HANDLE)
|
||||
if (g_map_array == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
RemoveAllMenuItems(menu);
|
||||
|
||||
decl String:map_name[64];
|
||||
new map_count = GetArraySize(g_map_array);
|
||||
char map_name[64];
|
||||
int map_count = GetArraySize(g_map_array);
|
||||
|
||||
for (new i = 0; i < map_count; i++)
|
||||
for (int i = 0; i < map_count; i++)
|
||||
{
|
||||
GetArrayString(g_map_array, i, map_name, sizeof(map_name));
|
||||
AddMenuItem(menu, map_name, map_name);
|
||||
menu.AddItem(map_name, map_name);
|
||||
}
|
||||
|
||||
return map_count;
|
||||
|
||||
@@ -89,16 +89,16 @@ PerformWho(client, target, ReplySource:reply, bool:is_admin)
|
||||
|
||||
DisplayWhoMenu(client)
|
||||
{
|
||||
new Handle:menu = CreateMenu(MenuHandler_Who);
|
||||
Menu menu = CreateMenu(MenuHandler_Who);
|
||||
|
||||
decl String:title[100];
|
||||
Format(title, sizeof(title), "%T:", "Identify player", client);
|
||||
SetMenuTitle(menu, title);
|
||||
SetMenuExitBackButton(menu, true);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
|
||||
AddTargetsToMenu2(menu, 0, COMMAND_FILTER_CONNECTED);
|
||||
|
||||
DisplayMenu(menu, client, MENU_TIME_FOREVER);
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_Who(Handle:topmenu,
|
||||
@@ -118,11 +118,11 @@ public AdminMenu_Who(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Who(Handle:menu, MenuAction:action, param1, param2)
|
||||
public MenuHandler_Who(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
CloseHandle(menu);
|
||||
delete menu;
|
||||
}
|
||||
else if (action == MenuAction_Cancel)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ public MenuHandler_Who(Handle:menu, MenuAction:action, param1, param2)
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
|
||||
GetMenuItem(menu, param2, info, sizeof(info));
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
|
||||
if ((target = GetClientOfUserId(userid)) == 0)
|
||||
|
||||
Reference in New Issue
Block a user