Update fun plugins for transitional syntax (#508)

This commit is contained in:
ErikMinekus
2016-05-11 10:56:12 -04:00
committed by Nicholas Hastings
parent d9fb0ba64e
commit 6d9f46e983
15 changed files with 428 additions and 424 deletions
+10 -11
View File
@@ -31,7 +31,7 @@
* Version: $Id$
*/
DisplayVoteAllTalkMenu(client)
void DisplayVoteAllTalkMenu(int client)
{
if (IsVoteInProgress())
{
@@ -47,10 +47,10 @@ DisplayVoteAllTalkMenu(client)
LogAction(client, -1, "\"%L\" initiated an alltalk vote.", client);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Alltalk");
g_voteType = voteType:alltalk;
g_voteType = alltalk;
g_voteInfo[VOTE_NAME][0] = '\0';
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
if (g_Cvar_Alltalk.BoolValue)
{
@@ -67,13 +67,12 @@ DisplayVoteAllTalkMenu(client)
g_hVoteMenu.DisplayVoteToAll(20);
}
public AdminMenu_VoteAllTalk(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_VoteAllTalk(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -90,7 +89,7 @@ public AdminMenu_VoteAllTalk(Handle:topmenu,
}
}
public Action:Command_VoteAlltalk(client, args)
public Action Command_VoteAlltalk(int client, int args)
{
if (args > 0)
{
+20 -19
View File
@@ -31,7 +31,7 @@
* Version: $Id$
*/
DisplayVoteBurnMenu(client, target, String:name[])
void DisplayVoteBurnMenu(int client, int target, char[] name)
{
if (!IsPlayerAlive(target))
{
@@ -45,9 +45,9 @@ DisplayVoteBurnMenu(client, target, String:name[])
LogAction(client, target, "\"%L\" initiated a burn vote against \"%L\"", client, target);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Burn", g_voteInfo[VOTE_NAME]);
g_voteType = voteType:burn;
g_voteType = burn;
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
g_hVoteMenu.SetTitle("Voteburn player");
g_hVoteMenu.AddItem(VOTE_YES, "Yes");
g_hVoteMenu.AddItem(VOTE_NO, "No");
@@ -55,11 +55,11 @@ DisplayVoteBurnMenu(client, target, String:name[])
g_hVoteMenu.DisplayVoteToAll(20);
}
DisplayBurnTargetMenu(client)
void DisplayBurnTargetMenu(int client)
{
Menu menu = CreateMenu(MenuHandler_Burn);
Menu menu = new Menu(MenuHandler_Burn);
decl String:title[100];
char title[100];
Format(title, sizeof(title), "%T:", "Burn vote", client);
menu.SetTitle(title);
menu.ExitBackButton = true;
@@ -69,12 +69,12 @@ DisplayBurnTargetMenu(client)
menu.Display(client, MENU_TIME_FOREVER);
}
public AdminMenu_VoteBurn(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_VoteBurn(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -91,7 +91,7 @@ public AdminMenu_VoteBurn(Handle:topmenu,
}
}
public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
public int MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
{
if (action == MenuAction_End)
{
@@ -106,8 +106,8 @@ public MenuHandler_Burn(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);
@@ -131,7 +131,7 @@ public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
}
}
public Action:Command_VoteBurn(client, args)
public Action Command_VoteBurn(int client, int args)
{
if (args < 1)
{
@@ -150,13 +150,14 @@ public Action:Command_VoteBurn(client, args)
return Plugin_Handled;
}
decl String:text[256], String:arg[64];
char text[256], arg[64];
GetCmdArgString(text, sizeof(text));
BreakString(text, arg, sizeof(arg));
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,
+10 -10
View File
@@ -31,7 +31,7 @@
* Version: $Id$
*/
DisplayVoteFFMenu(client)
void DisplayVoteFFMenu(int client)
{
if (IsVoteInProgress())
{
@@ -47,10 +47,10 @@ DisplayVoteFFMenu(client)
LogAction(client, -1, "\"%L\" initiated a friendly fire vote.", client);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote FF");
g_voteType = voteType:ff;
g_voteType = ff;
g_voteInfo[VOTE_NAME][0] = '\0';
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
if (g_Cvar_FF.BoolValue)
{
@@ -67,12 +67,12 @@ DisplayVoteFFMenu(client)
g_hVoteMenu.DisplayVoteToAll(20);
}
public AdminMenu_VoteFF(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_VoteFF(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -89,7 +89,7 @@ public AdminMenu_VoteFF(Handle:topmenu,
}
}
public Action:Command_VoteFF(client, args)
public Action Command_VoteFF(int client, int args)
{
if (args > 0)
{
+18 -19
View File
@@ -31,15 +31,14 @@
* Version: $Id$
*/
DisplayVoteGravityMenu(client,count,String:items[5][])
void DisplayVoteGravityMenu(int client, int count, char[][] items)
{
LogAction(client, -1, "\"%L\" initiated a gravity vote.", client);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Gravity");
g_voteType = voteType:gravity;
g_voteType = gravity;
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
if (count == 1)
{
@@ -54,7 +53,7 @@ DisplayVoteGravityMenu(client,count,String:items[5][])
g_voteInfo[VOTE_NAME][0] = '\0';
g_hVoteMenu.SetTitle("Gravity Vote");
for (new i = 0; i < count; i++)
for (int i = 0; i < count; i++)
{
g_hVoteMenu.AddItem(items[i], items[i]);
}
@@ -64,12 +63,12 @@ DisplayVoteGravityMenu(client,count,String:items[5][])
g_hVoteMenu.DisplayVoteToAll(20);
}
public AdminMenu_VoteGravity(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_VoteGravity(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -78,7 +77,7 @@ public AdminMenu_VoteGravity(Handle:topmenu,
else if (action == TopMenuAction_SelectOption)
{
/* Might need a better way of selecting the list of pre-defined gravity choices */
new String:items[5][5] ={"200","400","800","1600","3200"};
char items[5][5] ={"200","400","800","1600","3200"};
DisplayVoteGravityMenu(param,5, items);
}
else if (action == TopMenuAction_DrawOption)
@@ -88,7 +87,7 @@ public AdminMenu_VoteGravity(Handle:topmenu,
}
}
public Action:Command_VoteGravity(client, args)
public Action Command_VoteGravity(int client, int args)
{
if (args < 1)
{
@@ -107,18 +106,18 @@ public Action:Command_VoteGravity(client, args)
return Plugin_Handled;
}
decl String:text[256];
char text[256];
GetCmdArgString(text, sizeof(text));
decl String:items[5][64];
new count;
new len, pos;
char items[5][64];
int count;
int len, pos;
while (pos != -1 && count < 5)
{
pos = BreakString(text[len], items[count], sizeof(items[]));
decl Float:temp;
float temp;
if (StringToFloatEx(items[count], temp) == 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
@@ -136,4 +135,4 @@ public Action:Command_VoteGravity(client, args)
DisplayVoteGravityMenu(client, count, items);
return Plugin_Handled;
}
}
+20 -20
View File
@@ -31,8 +31,7 @@
* Version: $Id$
*/
DisplayVoteSlayMenu(client, target, String:name[])
void DisplayVoteSlayMenu(int client, int target, char[] name)
{
if (!IsPlayerAlive(target))
{
@@ -46,9 +45,9 @@ DisplayVoteSlayMenu(client, target, String:name[])
LogAction(client, target, "\"%L\" initiated a slay vote against \"%L\"", client, target);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Slay", g_voteInfo[VOTE_NAME]);
g_voteType = voteType:slay;
g_voteType = slay;
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
g_hVoteMenu = new Menu(Handler_VoteCallback, MENU_ACTIONS_ALL);
g_hVoteMenu.SetTitle("Voteslay Player");
g_hVoteMenu.AddItem(VOTE_YES, "Yes");
g_hVoteMenu.AddItem(VOTE_NO, "No");
@@ -56,11 +55,11 @@ DisplayVoteSlayMenu(client, target, String:name[])
g_hVoteMenu.DisplayVoteToAll(20);
}
DisplaySlayTargetMenu(client)
void DisplaySlayTargetMenu(int client)
{
Menu menu = CreateMenu(MenuHandler_Slay);
Menu menu = new Menu(MenuHandler_Slay);
decl String:title[100];
char title[100];
Format(title, sizeof(title), "%T:", "Slay vote", client);
menu.SetTitle(title);
menu.ExitBackButton = true;
@@ -70,12 +69,12 @@ DisplaySlayTargetMenu(client)
menu.Display(client, MENU_TIME_FOREVER);
}
public AdminMenu_VoteSlay(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
public void AdminMenu_VoteSlay(TopMenu topmenu,
TopMenuAction action,
TopMenuObject object_id,
int param,
char[] buffer,
int maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
@@ -92,7 +91,7 @@ public AdminMenu_VoteSlay(Handle:topmenu,
}
}
public MenuHandler_Slay(Menu menu, MenuAction action, int param1, int param2)
public int MenuHandler_Slay(Menu menu, MenuAction action, int param1, int param2)
{
if (action == MenuAction_End)
{
@@ -107,8 +106,8 @@ public MenuHandler_Slay(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);
@@ -132,7 +131,7 @@ public MenuHandler_Slay(Menu menu, MenuAction action, int param1, int param2)
}
}
public Action:Command_VoteSlay(client, args)
public Action Command_VoteSlay(int client, int args)
{
if (args < 1)
{
@@ -151,13 +150,14 @@ public Action:Command_VoteSlay(client, args)
return Plugin_Handled;
}
decl String:text[256], String:arg[64];
char text[256], arg[64];
GetCmdArgString(text, sizeof(text));
BreakString(text, arg, sizeof(arg));
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,