Update small plugins for transitional syntax (#506)
This commit is contained in:
committed by
Nicholas Hastings
parent
11b4320204
commit
e8734ccf28
@@ -31,9 +31,9 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new String:g_NewName[MAXPLAYERS+1][MAX_NAME_LENGTH];
|
||||
char g_NewName[MAXPLAYERS+1][MAX_NAME_LENGTH];
|
||||
|
||||
PerformRename(client, target)
|
||||
void PerformRename(int client, int target)
|
||||
{
|
||||
LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]);
|
||||
|
||||
@@ -42,12 +42,12 @@ PerformRename(client, target)
|
||||
g_NewName[target][0] = '\0';
|
||||
}
|
||||
|
||||
public AdminMenu_Rename(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Rename(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -59,9 +59,9 @@ public AdminMenu_Rename(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
DisplayRenameTargetMenu(int client)
|
||||
void DisplayRenameTargetMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Rename);
|
||||
Menu menu = new Menu(MenuHandler_Rename);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Rename player", client);
|
||||
@@ -73,7 +73,7 @@ DisplayRenameTargetMenu(int client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -88,8 +88,8 @@ public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:info[32];
|
||||
new userid, target;
|
||||
char info[32];
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -104,7 +104,7 @@ public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
RandomizeName(target);
|
||||
@@ -115,22 +115,22 @@ public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
RandomizeName(client)
|
||||
void RandomizeName(int client)
|
||||
{
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(client, name, sizeof(name));
|
||||
|
||||
new len = strlen(name);
|
||||
int len = strlen(name);
|
||||
g_NewName[client][0] = '\0';
|
||||
|
||||
for (new i = 0; i < len; i++)
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
g_NewName[client][i] = name[GetRandomInt(0, len - 1)];
|
||||
}
|
||||
g_NewName[client][len] = '\0';
|
||||
}
|
||||
|
||||
public Action:Command_Rename(client, args)
|
||||
public Action Command_Rename(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -138,10 +138,10 @@ public Action:Command_Rename(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[MAX_NAME_LENGTH], String:arg2[MAX_NAME_LENGTH];
|
||||
char arg[MAX_NAME_LENGTH], arg2[MAX_NAME_LENGTH];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new bool:randomize;
|
||||
bool randomize;
|
||||
if (args > 1)
|
||||
{
|
||||
GetCmdArg(2, arg2, sizeof(arg2));
|
||||
@@ -151,8 +151,9 @@ public Action:Command_Rename(client, args)
|
||||
randomize = true;
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -178,7 +179,7 @@ public Action:Command_Rename(client, args)
|
||||
randomize = true;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
if(randomize)
|
||||
{
|
||||
|
||||
@@ -31,17 +31,17 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
new g_SlapDamage[MAXPLAYERS+1];
|
||||
int g_SlapDamage[MAXPLAYERS+1];
|
||||
|
||||
PerformSlap(client, target, damage)
|
||||
void PerformSlap(int client, int target, int damage)
|
||||
{
|
||||
LogAction(client, target, "\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
|
||||
SlapPlayer(target, damage, true);
|
||||
}
|
||||
|
||||
DisplaySlapDamageMenu(client)
|
||||
void DisplaySlapDamageMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_SlapDamage);
|
||||
Menu menu = new Menu(MenuHandler_SlapDamage);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Slap damage", client);
|
||||
@@ -59,9 +59,9 @@ DisplaySlapDamageMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
DisplaySlapTargetMenu(client)
|
||||
void DisplaySlapTargetMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Slap);
|
||||
Menu menu = new Menu(MenuHandler_Slap);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T: %d damage", "Slap player", client, g_SlapDamage[client]);
|
||||
@@ -73,12 +73,12 @@ DisplaySlapTargetMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_Slap(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Slap(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public AdminMenu_Slap(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_SlapDamage(Menu menu, MenuAction action, param1, param2)
|
||||
public int MenuHandler_SlapDamage(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -114,7 +114,7 @@ public MenuHandler_SlapDamage(Menu menu, MenuAction action, param1, param2)
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
public int MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
char info[32];
|
||||
new userid, target;
|
||||
int userid, target;
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
userid = StringToInt(info);
|
||||
@@ -149,7 +149,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformSlap(param1, target, g_SlapDamage[param1]);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Slapped target", "_s", name);
|
||||
@@ -159,7 +159,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Slap(client, args)
|
||||
public Action Command_Slap(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -167,13 +167,13 @@ public Action:Command_Slap(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new damage = 0;
|
||||
int damage = 0;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:arg2[20];
|
||||
char arg2[20];
|
||||
GetCmdArg(2, arg2, sizeof(arg2));
|
||||
if (StringToIntEx(arg2, damage) == 0 || damage < 0)
|
||||
{
|
||||
@@ -182,8 +182,9 @@ public Action:Command_Slap(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -199,7 +200,7 @@ public Action:Command_Slap(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformSlap(client, target_list[i], damage);
|
||||
}
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
PerformSlay(client, target)
|
||||
void PerformSlay(int client, int target)
|
||||
{
|
||||
LogAction(client, target, "\"%L\" slayed \"%L\"", client, target);
|
||||
ForcePlayerSuicide(target);
|
||||
}
|
||||
|
||||
DisplaySlayMenu(client)
|
||||
void DisplaySlayMenu(int client)
|
||||
{
|
||||
Menu menu = CreateMenu(MenuHandler_Slay);
|
||||
Menu menu = new Menu(MenuHandler_Slay);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T:", "Slay player", client);
|
||||
@@ -51,12 +51,12 @@ DisplaySlayMenu(client)
|
||||
menu.Display(client, MENU_TIME_FOREVER);
|
||||
}
|
||||
|
||||
public AdminMenu_Slay(Handle:topmenu,
|
||||
TopMenuAction:action,
|
||||
TopMenuObject:object_id,
|
||||
param,
|
||||
String:buffer[],
|
||||
maxlength)
|
||||
public void AdminMenu_Slay(TopMenu topmenu,
|
||||
TopMenuAction action,
|
||||
TopMenuObject object_id,
|
||||
int param,
|
||||
char[] buffer,
|
||||
int maxlength)
|
||||
{
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public AdminMenu_Slay(Handle:topmenu,
|
||||
}
|
||||
}
|
||||
|
||||
public MenuHandler_Slay(Menu menu, MenuAction action, param1, param2)
|
||||
public int MenuHandler_Slay(Menu menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
if (action == MenuAction_End)
|
||||
{
|
||||
@@ -103,7 +103,7 @@ public MenuHandler_Slay(Menu menu, MenuAction action, param1, param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformSlay(param1, target);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name);
|
||||
@@ -113,7 +113,7 @@ public MenuHandler_Slay(Menu menu, MenuAction action, param1, param2)
|
||||
}
|
||||
}
|
||||
|
||||
public Action:Command_Slay(client, args)
|
||||
public Action Command_Slay(int client, int args)
|
||||
{
|
||||
if (args < 1)
|
||||
{
|
||||
@@ -121,11 +121,12 @@ public Action:Command_Slay(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:arg[65];
|
||||
char arg[65];
|
||||
GetCmdArg(1, 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,
|
||||
@@ -141,7 +142,7 @@ public Action:Command_Slay(client, args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (new i = 0; i < target_count; i++)
|
||||
for (int i = 0; i < target_count; i++)
|
||||
{
|
||||
PerformSlay(client, target_list[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user