Update small plugins for transitional syntax (#506)

This commit is contained in:
ErikMinekus 2016-05-11 15:32:34 +02:00 committed by Nicholas Hastings
parent 11b4320204
commit e8734ccf28
17 changed files with 117 additions and 113 deletions

View File

@ -247,4 +247,3 @@ void ReadGroups()
InternalReadGroups(g_Filename, GroupPass_Second); InternalReadGroups(g_Filename, GroupPass_Second);
} }
} }

View File

@ -88,8 +88,6 @@ public void ReadSimpleUsers()
file.Close(); file.Close();
} }
void DecodeAuthMethod(const char[] auth, char method[32], int &offset) void DecodeAuthMethod(const char[] auth, char method[32], int &offset)
{ {
if ((StrContains(auth, "STEAM_") == 0) || (strncmp("0:", auth, 2) == 0) || (strncmp("1:", auth, 2) == 0)) if ((StrContains(auth, "STEAM_") == 0) || (strncmp("0:", auth, 2) == 0) || (strncmp("1:", auth, 2) == 0))
@ -224,4 +222,3 @@ void ReadAdminLine(const char[] line)
} }
} }
} }

View File

@ -164,7 +164,7 @@ public SMCResult ReadUsers_EndSection(SMCParser smc)
if ((id = FindAdminByIdentity(g_CurAuth, g_CurIdent)) == INVALID_ADMIN_ID) if ((id = FindAdminByIdentity(g_CurAuth, g_CurIdent)) == INVALID_ADMIN_ID)
{ {
id = CreateAdmin(g_CurName); id = CreateAdmin(g_CurName);
if (!BindAdminIdentity(id, g_CurAuth, g_CurIdent)) if (!id.BindIdentity(g_CurAuth, g_CurIdent))
{ {
RemoveAdmin(id); RemoveAdmin(id);
ParseError("Failed to bind auth \"%s\" to identity \"%s\"", g_CurAuth, g_CurIdent); ParseError("Failed to bind auth \"%s\" to identity \"%s\"", g_CurAuth, g_CurIdent);
@ -175,19 +175,19 @@ public SMCResult ReadUsers_EndSection(SMCParser smc)
num_groups = g_GroupArray.Length; num_groups = g_GroupArray.Length;
for (i = 0; i < num_groups; i++) for (i = 0; i < num_groups; i++)
{ {
AdminInheritGroup(id, g_GroupArray.Get(i)); id.InheritGroup(g_GroupArray.Get(i));
} }
SetAdminPassword(id, g_CurPass); id.SetPassword(g_CurPass);
if (GetAdminImmunityLevel(id) < g_CurImmunity) if (id.ImmunityLevel < g_CurImmunity)
{ {
SetAdminImmunityLevel(id, g_CurImmunity); id.ImmunityLevel = g_CurImmunity;
} }
num_flags = FlagBitsToArray(g_CurFlags, flags, sizeof(flags)); num_flags = FlagBitsToArray(g_CurFlags, flags, sizeof(flags));
for (i = 0; i < num_flags; i++) for (i = 0; i < num_flags; i++)
{ {
SetAdminFlag(id, flags[i], true); id.SetFlag(flags[i], true);
} }
} }
else else
@ -222,7 +222,7 @@ static void InitializeUserParser()
g_hUserParser.OnLeaveSection = ReadUsers_EndSection; g_hUserParser.OnLeaveSection = ReadUsers_EndSection;
g_hUserParser.OnRawLine = ReadUsers_CurrentLine; g_hUserParser.OnRawLine = ReadUsers_CurrentLine;
g_GroupArray = CreateArray(); g_GroupArray = new ArrayList();
} }
} }

View File

@ -377,4 +377,3 @@ void FetchOverrides(Database db)
delete rs; delete rs;
} }

View File

@ -534,7 +534,6 @@ void FetchUsersWeCan(Database db)
RebuildCachePart[AdminCache_Admins] = 0; RebuildCachePart[AdminCache_Admins] = 0;
} }
public void OnReceiveGroupImmunity(Database db, DBResultSet rs, const char[] error, any data) public void OnReceiveGroupImmunity(Database db, DBResultSet rs, const char[] error, any data)
{ {
DataPack pk = view_as<DataPack>(data); DataPack pk = view_as<DataPack>(data);
@ -846,4 +845,3 @@ void FetchOverrides(Database db, int sequence)
db.Query(OnReceiveOverrides, query, pk, DBPrio_High); db.Query(OnReceiveOverrides, query, pk, DBPrio_High);
} }

View File

@ -35,6 +35,8 @@
#include <sourcemod> #include <sourcemod>
#pragma newdecls required
#define COMMANDS_PER_PAGE 10 #define COMMANDS_PER_PAGE 10
public Plugin myinfo = public Plugin myinfo =

View File

@ -36,6 +36,8 @@
#include <sourcemod> #include <sourcemod>
#include <topmenus> #include <topmenus>
#pragma newdecls required
public Plugin myinfo = public Plugin myinfo =
{ {
name = "Admin Menu", name = "Admin Menu",
@ -117,7 +119,7 @@ public void OnAllPluginsLoaded()
Call_Finish(); Call_Finish();
} }
public void DefaultCategoryHandler(Handle topmenu, public void DefaultCategoryHandler(TopMenu topmenu,
TopMenuAction action, TopMenuAction action,
TopMenuObject object_id, TopMenuObject object_id,
int param, int param,
@ -265,4 +267,3 @@ stock int UTIL_AddTargetsToMenu(Menu menu, int source_client, bool in_game_only,
return UTIL_AddTargetsToMenu2(menu, source_client, flags); return UTIL_AddTargetsToMenu2(menu, source_client, flags);
} }

View File

@ -75,7 +75,7 @@ ArrayList g_DataArray;
void BuildDynamicMenu() void BuildDynamicMenu()
{ {
int itemInput[Item]; int itemInput[Item];
g_DataArray = CreateArray(sizeof(itemInput)); g_DataArray = new ArrayList(sizeof(itemInput));
char executeBuffer[32]; char executeBuffer[32];
@ -175,7 +175,7 @@ void BuildDynamicMenu()
if (count == 1) if (count == 1)
{ {
itemInput[Item_submenus] = CreateArray(sizeof(submenuInput)); itemInput[Item_submenus] = new ArrayList(sizeof(submenuInput));
} }
kvMenu.GetString("type", inputBuffer, sizeof(inputBuffer)); kvMenu.GetString("type", inputBuffer, sizeof(inputBuffer));
@ -197,7 +197,7 @@ void BuildDynamicMenu()
kvMenu.GetString("path", inputBuffer, sizeof(inputBuffer),"mapcycle.txt"); kvMenu.GetString("path", inputBuffer, sizeof(inputBuffer),"mapcycle.txt");
submenuInput[Submenu_listdata] = CreateDataPack(); submenuInput[Submenu_listdata] = new DataPack();
submenuInput[Submenu_listdata].WriteString(inputBuffer); submenuInput[Submenu_listdata].WriteString(inputBuffer);
submenuInput[Submenu_listdata].Reset(); submenuInput[Submenu_listdata].Reset();
} }
@ -213,7 +213,7 @@ void BuildDynamicMenu()
{ {
submenuInput[Submenu_type] = SubMenu_List; submenuInput[Submenu_type] = SubMenu_List;
submenuInput[Submenu_listdata] = CreateDataPack(); submenuInput[Submenu_listdata] = new DataPack();
char temp[6]; char temp[6];
char value[64]; char value[64];
@ -334,8 +334,8 @@ void ParseConfigs()
delete g_groupList[groupListName]; delete g_groupList[groupListName];
delete g_groupList[groupListCommand]; delete g_groupList[groupListCommand];
g_groupList[groupListName] = CreateArray(ARRAY_STRING_LENGTH); g_groupList[groupListName] = new ArrayList(ARRAY_STRING_LENGTH);
g_groupList[groupListCommand] = CreateArray(ARRAY_STRING_LENGTH); g_groupList[groupListCommand] = new ArrayList(ARRAY_STRING_LENGTH);
char configPath[256]; char configPath[256];
BuildPath(Path_SM, configPath, sizeof(configPath), "configs/dynamicmenu/adminmenu_grouping.txt"); BuildPath(Path_SM, configPath, sizeof(configPath), "configs/dynamicmenu/adminmenu_grouping.txt");
@ -450,7 +450,7 @@ public void ParamCheck(int client)
{ {
outputItem[Item_submenus].GetArray(g_currentPlace[client][Place_ReplaceNum] - 1, outputSubmenu[0]); outputItem[Item_submenus].GetArray(g_currentPlace[client][Place_ReplaceNum] - 1, outputSubmenu[0]);
Menu itemMenu = CreateMenu(Menu_Selection); Menu itemMenu = new Menu(Menu_Selection);
itemMenu.ExitBackButton = true; itemMenu.ExitBackButton = true;
if ((outputSubmenu[Submenu_type] == SubMenu_Group) || (outputSubmenu[Submenu_type] == SubMenu_GroupPlayer)) if ((outputSubmenu[Submenu_type] == SubMenu_Group) || (outputSubmenu[Submenu_type] == SubMenu_GroupPlayer))
@ -645,7 +645,6 @@ public int Menu_Selection(Menu menu, MenuAction action, int param1, int param2)
return 0; return 0;
} }
stock bool QuoteString(char[] input, char[] output, int maxlen, char[] quotechars) stock bool QuoteString(char[] input, char[] output, int maxlen, char[] quotechars)
{ {
int count = 0; int count = 0;

View File

@ -35,7 +35,9 @@
#include <sourcemod> #include <sourcemod>
public Plugin:myinfo = #pragma newdecls required
public Plugin myinfo =
{ {
name = "Anti-Flood", name = "Anti-Flood",
author = "AlliedModders LLC", author = "AlliedModders LLC",
@ -44,17 +46,17 @@ public Plugin:myinfo =
url = "http://www.sourcemod.net/" url = "http://www.sourcemod.net/"
}; };
new Float:g_LastTime[MAXPLAYERS + 1] = {0.0, ...}; /* Last time player used say or say_team */ float g_LastTime[MAXPLAYERS + 1] = {0.0, ...}; /* Last time player used say or say_team */
new g_FloodTokens[MAXPLAYERS + 1] = {0, ...}; /* Number of flood tokens player has */ int g_FloodTokens[MAXPLAYERS + 1] = {0, ...}; /* Number of flood tokens player has */
ConVar sm_flood_time; /* Handle to sm_flood_time convar */ ConVar sm_flood_time; /* Handle to sm_flood_time convar */
public OnPluginStart() public void OnPluginStart()
{ {
sm_flood_time = CreateConVar("sm_flood_time", "0.75", "Amount of time allowed between chat messages"); sm_flood_time = CreateConVar("sm_flood_time", "0.75", "Amount of time allowed between chat messages");
} }
public OnClientPutInServer(client) public void OnClientPutInServer(int client)
{ {
g_LastTime[client] = 0.0; g_LastTime[client] = 0.0;
g_FloodTokens[client] = 0; g_FloodTokens[client] = 0;
@ -84,7 +86,7 @@ public bool OnClientFloodCheck(int client)
return false; return false;
} }
public OnClientFloodResult(client, bool:blocked) public void OnClientFloodResult(int client, bool blocked)
{ {
if (max_chat <= 0.0 if (max_chat <= 0.0
|| CheckCommandAccess(client, "sm_flood_access", ADMFLAG_ROOT, true)) || CheckCommandAccess(client, "sm_flood_access", ADMFLAG_ROOT, true))
@ -92,8 +94,8 @@ public OnClientFloodResult(client, bool:blocked)
return; return;
} }
new Float:curTime = GetGameTime(); float curTime = GetGameTime();
new Float:newTime = curTime + max_chat; float newTime = curTime + max_chat;
if (g_LastTime[client] >= curTime) if (g_LastTime[client] >= curTime)
{ {

View File

@ -37,7 +37,9 @@
#include <sourcemod> #include <sourcemod>
#include <clientprefs> #include <clientprefs>
public Plugin:myinfo = #pragma newdecls required
public Plugin myinfo =
{ {
name = "Client Preferences", name = "Client Preferences",
author = "AlliedModders LLC", author = "AlliedModders LLC",
@ -46,7 +48,7 @@ public Plugin:myinfo =
url = "http://www.sourcemod.net/" url = "http://www.sourcemod.net/"
}; };
public OnPluginStart() public void OnPluginStart()
{ {
LoadTranslations("clientprefs.phrases"); LoadTranslations("clientprefs.phrases");
@ -54,7 +56,7 @@ public OnPluginStart()
RegConsoleCmd("sm_settings", Command_Settings); RegConsoleCmd("sm_settings", Command_Settings);
} }
public Action:Command_Cookie(client, args) public Action Command_Cookie(int client, int args)
{ {
if (args == 0) if (args == 0)
{ {
@ -62,16 +64,16 @@ public Action:Command_Cookie(client, args)
ReplyToCommand(client, "[SM] %t", "Printing Cookie List"); ReplyToCommand(client, "[SM] %t", "Printing Cookie List");
/* Show list of cookies */ /* Show list of cookies */
new Handle:iter = GetCookieIterator(); Handle iter = GetCookieIterator();
decl String:name[30]; char name[30];
name[0] = '\0'; name[0] = '\0';
decl String:description[255]; char description[255];
description[0] = '\0'; description[0] = '\0';
PrintToConsole(client, "%t:", "Cookie List"); PrintToConsole(client, "%t:", "Cookie List");
new CookieAccess:access; CookieAccess access;
while (ReadCookieIterator(iter, while (ReadCookieIterator(iter,
name, name,
@ -96,11 +98,11 @@ public Action:Command_Cookie(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:name[30]; char name[30];
name[0] = '\0'; name[0] = '\0';
GetCmdArg(1, name, sizeof(name)); GetCmdArg(1, name, sizeof(name));
new Handle:cookie = FindClientCookie(name); Handle cookie = FindClientCookie(name);
if (cookie == null) if (cookie == null)
{ {
@ -108,7 +110,7 @@ public Action:Command_Cookie(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
new CookieAccess:access = GetCookieAccess(cookie); CookieAccess access = GetCookieAccess(cookie);
if (access == CookieAccess_Private) if (access == CookieAccess_Private)
{ {
@ -117,7 +119,7 @@ public Action:Command_Cookie(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:value[100]; char value[100];
value[0] = '\0'; value[0] = '\0';
if (args == 1) if (args == 1)
@ -147,7 +149,7 @@ public Action:Command_Cookie(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
public Action:Command_Settings(client, args) public Action Command_Settings(int client, int args)
{ {
if (client == 0) if (client == 0)
{ {

View File

@ -73,7 +73,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
return APLRes_Success; return APLRes_Success;
} }
public void OnPluginStart() public void OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");

View File

@ -38,7 +38,9 @@
#undef REQUIRE_PLUGIN #undef REQUIRE_PLUGIN
#include <adminmenu> #include <adminmenu>
public Plugin:myinfo = #pragma newdecls required
public Plugin myinfo =
{ {
name = "Player Commands", name = "Player Commands",
author = "AlliedModders LLC", author = "AlliedModders LLC",
@ -54,7 +56,7 @@ TopMenu hTopMenu;
#include "playercommands/slap.sp" #include "playercommands/slap.sp"
#include "playercommands/rename.sp" #include "playercommands/rename.sp"
public OnPluginStart() public void OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");
LoadTranslations("playercommands.phrases"); LoadTranslations("playercommands.phrases");
@ -71,7 +73,7 @@ public OnPluginStart()
} }
} }
public OnAdminMenuReady(Handle aTopMenu) public void OnAdminMenuReady(Handle aTopMenu)
{ {
TopMenu topmenu = TopMenu.FromHandle(aTopMenu); TopMenu topmenu = TopMenu.FromHandle(aTopMenu);

View File

@ -31,9 +31,9 @@
* Version: $Id$ * 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]); 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'; g_NewName[target][0] = '\0';
} }
public AdminMenu_Rename(Handle:topmenu, public void AdminMenu_Rename(TopMenu topmenu,
TopMenuAction:action, TopMenuAction action,
TopMenuObject:object_id, TopMenuObject object_id,
param, int param,
String:buffer[], char[] buffer,
maxlength) int maxlength)
{ {
if (action == TopMenuAction_DisplayOption) 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]; char title[100];
Format(title, sizeof(title), "%T:", "Rename player", client); Format(title, sizeof(title), "%T:", "Rename player", client);
@ -73,7 +73,7 @@ DisplayRenameTargetMenu(int client)
menu.Display(client, MENU_TIME_FOREVER); 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) if (action == MenuAction_End)
{ {
@ -88,8 +88,8 @@ public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
} }
else if (action == MenuAction_Select) else if (action == MenuAction_Select)
{ {
decl String:info[32]; char info[32];
new userid, target; int userid, target;
menu.GetItem(param2, info, sizeof(info)); menu.GetItem(param2, info, sizeof(info));
userid = StringToInt(info); userid = StringToInt(info);
@ -104,7 +104,7 @@ public MenuHandler_Rename(Menu menu, MenuAction action, int param1, int param2)
} }
else else
{ {
decl String:name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name)); GetClientName(target, name, sizeof(name));
RandomizeName(target); 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)); GetClientName(client, name, sizeof(name));
new len = strlen(name); int len = strlen(name);
g_NewName[client][0] = '\0'; 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][i] = name[GetRandomInt(0, len - 1)];
} }
g_NewName[client][len] = '\0'; g_NewName[client][len] = '\0';
} }
public Action:Command_Rename(client, args) public Action Command_Rename(int client, int args)
{ {
if (args < 1) if (args < 1)
{ {
@ -138,10 +138,10 @@ public Action:Command_Rename(client, args)
return Plugin_Handled; 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)); GetCmdArg(1, arg, sizeof(arg));
new bool:randomize; bool randomize;
if (args > 1) if (args > 1)
{ {
GetCmdArg(2, arg2, sizeof(arg2)); GetCmdArg(2, arg2, sizeof(arg2));
@ -151,8 +151,9 @@ public Action:Command_Rename(client, args)
randomize = true; randomize = true;
} }
decl String:target_name[MAX_TARGET_LENGTH]; char target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString( if ((target_count = ProcessTargetString(
arg, arg,
@ -178,7 +179,7 @@ public Action:Command_Rename(client, args)
randomize = true; randomize = true;
} }
for (new i = 0; i < target_count; i++) for (int i = 0; i < target_count; i++)
{ {
if(randomize) if(randomize)
{ {

View File

@ -31,17 +31,17 @@
* Version: $Id$ * 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); LogAction(client, target, "\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
SlapPlayer(target, damage, true); SlapPlayer(target, damage, true);
} }
DisplaySlapDamageMenu(client) void DisplaySlapDamageMenu(int client)
{ {
Menu menu = CreateMenu(MenuHandler_SlapDamage); Menu menu = new Menu(MenuHandler_SlapDamage);
char title[100]; char title[100];
Format(title, sizeof(title), "%T:", "Slap damage", client); Format(title, sizeof(title), "%T:", "Slap damage", client);
@ -59,9 +59,9 @@ DisplaySlapDamageMenu(client)
menu.Display(client, MENU_TIME_FOREVER); 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]; char title[100];
Format(title, sizeof(title), "%T: %d damage", "Slap player", client, g_SlapDamage[client]); 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); menu.Display(client, MENU_TIME_FOREVER);
} }
public AdminMenu_Slap(Handle:topmenu, public void AdminMenu_Slap(TopMenu topmenu,
TopMenuAction:action, TopMenuAction action,
TopMenuObject:object_id, TopMenuObject object_id,
param, int param,
String:buffer[], char[] buffer,
maxlength) int maxlength)
{ {
if (action == TopMenuAction_DisplayOption) 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) 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) if (action == MenuAction_End)
{ {
@ -130,7 +130,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
else if (action == MenuAction_Select) else if (action == MenuAction_Select)
{ {
char info[32]; char info[32];
new userid, target; int userid, target;
menu.GetItem(param2, info, sizeof(info)); menu.GetItem(param2, info, sizeof(info));
userid = StringToInt(info); userid = StringToInt(info);
@ -149,7 +149,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
} }
else else
{ {
decl String:name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name)); GetClientName(target, name, sizeof(name));
PerformSlap(param1, target, g_SlapDamage[param1]); PerformSlap(param1, target, g_SlapDamage[param1]);
ShowActivity2(param1, "[SM] ", "%t", "Slapped target", "_s", name); 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) if (args < 1)
{ {
@ -167,13 +167,13 @@ public Action:Command_Slap(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:arg[65]; char arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
new damage = 0; int damage = 0;
if (args > 1) if (args > 1)
{ {
decl String:arg2[20]; char arg2[20];
GetCmdArg(2, arg2, sizeof(arg2)); GetCmdArg(2, arg2, sizeof(arg2));
if (StringToIntEx(arg2, damage) == 0 || damage < 0) if (StringToIntEx(arg2, damage) == 0 || damage < 0)
{ {
@ -182,8 +182,9 @@ public Action:Command_Slap(client, args)
} }
} }
decl String:target_name[MAX_TARGET_LENGTH]; char target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString( if ((target_count = ProcessTargetString(
arg, arg,
@ -199,7 +200,7 @@ public Action:Command_Slap(client, args)
return Plugin_Handled; 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); PerformSlap(client, target_list[i], damage);
} }

View File

@ -31,15 +31,15 @@
* Version: $Id$ * Version: $Id$
*/ */
PerformSlay(client, target) void PerformSlay(int client, int target)
{ {
LogAction(client, target, "\"%L\" slayed \"%L\"", client, target); LogAction(client, target, "\"%L\" slayed \"%L\"", client, target);
ForcePlayerSuicide(target); ForcePlayerSuicide(target);
} }
DisplaySlayMenu(client) void DisplaySlayMenu(int client)
{ {
Menu menu = CreateMenu(MenuHandler_Slay); Menu menu = new Menu(MenuHandler_Slay);
char title[100]; char title[100];
Format(title, sizeof(title), "%T:", "Slay player", client); Format(title, sizeof(title), "%T:", "Slay player", client);
@ -51,12 +51,12 @@ DisplaySlayMenu(client)
menu.Display(client, MENU_TIME_FOREVER); menu.Display(client, MENU_TIME_FOREVER);
} }
public AdminMenu_Slay(Handle:topmenu, public void AdminMenu_Slay(TopMenu topmenu,
TopMenuAction:action, TopMenuAction action,
TopMenuObject:object_id, TopMenuObject object_id,
param, int param,
String:buffer[], char[] buffer,
maxlength) int maxlength)
{ {
if (action == TopMenuAction_DisplayOption) 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) if (action == MenuAction_End)
{ {
@ -103,7 +103,7 @@ public MenuHandler_Slay(Menu menu, MenuAction action, param1, param2)
} }
else else
{ {
decl String:name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name)); GetClientName(target, name, sizeof(name));
PerformSlay(param1, target); PerformSlay(param1, target);
ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name); 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) if (args < 1)
{ {
@ -121,11 +121,12 @@ public Action:Command_Slay(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:arg[65]; char arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
decl String:target_name[MAX_TARGET_LENGTH]; char target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString( if ((target_count = ProcessTargetString(
arg, arg,
@ -141,7 +142,7 @@ public Action:Command_Slay(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
for (new i = 0; i < target_count; i++) for (int i = 0; i < target_count; i++)
{ {
PerformSlay(client, target_list[i]); PerformSlay(client, target_list[i]);
} }

View File

@ -35,6 +35,8 @@
#include <sourcemod> #include <sourcemod>
#pragma newdecls required
public Plugin myinfo = public Plugin myinfo =
{ {
name = "Reserved Slots", name = "Reserved Slots",

View File

@ -224,7 +224,6 @@ bool GetUpdateVersion(int client, Database db, int versions[4])
return false; return false;
} }
return true; return true;
} }