Update base plugins for transitional syntax (#507)

This commit is contained in:
ErikMinekus
2016-05-11 10:44:58 -04:00
committed by Nicholas Hastings
parent e8734ccf28
commit d9fb0ba64e
18 changed files with 483 additions and 465 deletions
+26 -24
View File
@@ -31,7 +31,7 @@
* Version: $Id$
*/
public MenuHandler_ChangeMap(Menu menu, MenuAction action, int param1, int param2)
public int MenuHandler_ChangeMap(Menu menu, MenuAction action, int param1, int param2)
{
if (action == MenuAction_Cancel)
{
@@ -42,7 +42,7 @@ public MenuHandler_ChangeMap(Menu menu, MenuAction action, int param1, int param
}
else if (action == MenuAction_Select)
{
decl String:map[64];
char map[64];
menu.GetItem(param2, map, sizeof(map));
@@ -50,24 +50,26 @@ public MenuHandler_ChangeMap(Menu menu, MenuAction action, int param1, int param
LogAction(param1, -1, "\"%L\" changed map to \"%s\"", param1, map);
new Handle:dp;
DataPack dp;
CreateDataTimer(3.0, Timer_ChangeMap, dp);
WritePackString(dp, map);
dp.WriteString(map);
}
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);
}
}
public AdminMenu_Map(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_Map(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -79,7 +81,7 @@ public AdminMenu_Map(Handle:topmenu,
}
}
public Action:Command_Map(client, args)
public Action Command_Map(int client, int args)
{
if (args < 1)
{
@@ -87,7 +89,7 @@ public Action:Command_Map(client, args)
return Plugin_Handled;
}
decl String:map[64];
char map[64];
GetCmdArg(1, map, sizeof(map));
if (!IsMapValid(map))
@@ -100,31 +102,31 @@ public Action:Command_Map(client, args)
LogAction(client, -1, "\"%L\" changed map to \"%s\"", client, map);
new Handle:dp;
DataPack dp;
CreateDataTimer(3.0, Timer_ChangeMap, dp);
WritePackString(dp, map);
dp.WriteString(map);
return Plugin_Handled;
}
public Action:Timer_ChangeMap(Handle:timer, Handle:dp)
public Action Timer_ChangeMap(Handle timer, DataPack dp)
{
decl String:map[65];
char map[65];
ResetPack(dp);
ReadPackString(dp, map, sizeof(map));
dp.Reset();
dp.ReadString(map, sizeof(map));
ForceChangeLevel(map, "sm_map Command");
return Plugin_Stop;
}
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,
@@ -140,7 +142,7 @@ int LoadMapList(Menu menu)
return 0;
}
RemoveAllMenuItems(menu);
menu.RemoveAllItems();
char map_name[64];
int map_count = GetArraySize(g_map_array);