From fb2117137ef960bfac37bdcce107fd112890b443 Mon Sep 17 00:00:00 2001 From: ErikMinekus Date: Wed, 27 Apr 2016 15:34:22 +0200 Subject: [PATCH] Update basebans and SQL admins plugins for transitional syntax (#484) --- plugins/admin-sql-prefetch.sp | 2 + plugins/admin-sql-threaded.sp | 2 + plugins/basebans.sp | 73 ++++++++++++++++++---------------- plugins/basebans/ban.sp | 68 +++++++++++++++---------------- plugins/include/banning.inc | 69 ++++++++++++++++---------------- plugins/sql-admin-manager.sp | 75 ++++++++++++++++++----------------- 6 files changed, 148 insertions(+), 141 deletions(-) diff --git a/plugins/admin-sql-prefetch.sp b/plugins/admin-sql-prefetch.sp index cdaca240..3d1b4474 100644 --- a/plugins/admin-sql-prefetch.sp +++ b/plugins/admin-sql-prefetch.sp @@ -36,6 +36,8 @@ #include +#pragma newdecls required + public Plugin myinfo = { name = "SQL Admins (Prefetch)", diff --git a/plugins/admin-sql-threaded.sp b/plugins/admin-sql-threaded.sp index e65a1a64..6e855466 100644 --- a/plugins/admin-sql-threaded.sp +++ b/plugins/admin-sql-threaded.sp @@ -36,6 +36,8 @@ #include +#pragma newdecls required + public Plugin myinfo = { name = "SQL Admins (Threaded)", diff --git a/plugins/basebans.sp b/plugins/basebans.sp index 99498c0d..58b7788e 100644 --- a/plugins/basebans.sp +++ b/plugins/basebans.sp @@ -37,7 +37,9 @@ #undef REQUIRE_PLUGIN #include -public Plugin:myinfo = +#pragma newdecls required + +public Plugin myinfo = { name = "Basic Ban Commands", author = "AlliedModders LLC", @@ -48,17 +50,17 @@ public Plugin:myinfo = TopMenu hTopMenu; -new g_BanTarget[MAXPLAYERS+1]; -new g_BanTargetUserId[MAXPLAYERS+1]; -new g_BanTime[MAXPLAYERS+1]; +int g_BanTarget[MAXPLAYERS+1]; +int g_BanTargetUserId[MAXPLAYERS+1]; +int g_BanTime[MAXPLAYERS+1]; -new g_IsWaitingForChatReason[MAXPLAYERS+1]; +bool g_IsWaitingForChatReason[MAXPLAYERS+1]; KeyValues g_hKvBanReasons; -new String:g_BanReasonsPath[PLATFORM_MAX_PATH]; +char g_BanReasonsPath[PLATFORM_MAX_PATH]; #include "basebans/ban.sp" -public OnPluginStart() +public void OnPluginStart() { BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt"); @@ -84,18 +86,18 @@ public OnPluginStart() } } -public OnMapStart() +public void OnMapStart() { //(Re-)Load BanReasons LoadBanReasons(); } -public OnClientDisconnect(client) +public void OnClientDisconnect(int client) { g_IsWaitingForChatReason[client] = false; } -LoadBanReasons() +void LoadBanReasons() { delete g_hKvBanReasons; @@ -124,7 +126,7 @@ LoadBanReasons() } } -public OnAdminMenuReady(Handle aTopMenu) +public void OnAdminMenuReady(Handle aTopMenu) { TopMenu topmenu = TopMenu.FromHandle(aTopMenu); @@ -138,7 +140,7 @@ public OnAdminMenuReady(Handle aTopMenu) hTopMenu = topmenu; /* Find the "Player Commands" category */ - new TopMenuObject:player_commands = hTopMenu.FindCategory(ADMINMENU_PLAYERCOMMANDS); + TopMenuObject player_commands = hTopMenu.FindCategory(ADMINMENU_PLAYERCOMMANDS); if (player_commands != INVALID_TOPMENUOBJECT) { @@ -146,7 +148,7 @@ public OnAdminMenuReady(Handle aTopMenu) } } -public Action:Command_BanIp(client, args) +public Action Command_BanIp(int client, int args) { if (args < 2) { @@ -154,9 +156,9 @@ public Action:Command_BanIp(client, args) return Plugin_Handled; } - decl len, next_len; - decl String:Arguments[256]; - decl String:arg[50], String:time[20]; + int len, next_len; + char Arguments[256]; + char arg[50], time[20]; GetCmdArgString(Arguments, sizeof(Arguments)); len = BreakString(Arguments, arg, sizeof(arg)); @@ -177,9 +179,10 @@ public Action:Command_BanIp(client, args) return Plugin_Handled; } - decl String:target_name[MAX_TARGET_LENGTH]; - decl target_list[1], bool:tn_is_ml; - new found_client = -1; + char target_name[MAX_TARGET_LENGTH]; + int target_list[1]; + bool tn_is_ml; + int found_client = -1; if (ProcessTargetString( arg, @@ -194,7 +197,7 @@ public Action:Command_BanIp(client, args) found_client = target_list[0]; } - new bool:has_rcon; + bool has_rcon; if (client == 0 || (client == 1 && !IsDedicatedServer())) { @@ -202,11 +205,11 @@ public Action:Command_BanIp(client, args) } else { - new AdminId:id = GetUserAdmin(client); + AdminId id = GetUserAdmin(client); has_rcon = (id == INVALID_ADMIN_ID) ? false : GetAdminFlag(id, Admin_RCON); } - new hit_client = -1; + int hit_client = -1; if (found_client != -1 && !IsFakeClient(found_client) && (has_rcon || CanUserTarget(client, found_client))) @@ -221,7 +224,7 @@ public Action:Command_BanIp(client, args) return Plugin_Handled; } - new minutes = StringToInt(time); + int minutes = StringToInt(time); LogAction(client, hit_client, @@ -248,7 +251,7 @@ public Action:Command_BanIp(client, args) return Plugin_Handled; } -public Action:Command_AddBan(client, args) +public Action Command_AddBan(int client, int args) { if (args < 2) { @@ -256,13 +259,13 @@ public Action:Command_AddBan(client, args) return Plugin_Handled; } - decl String:arg_string[256]; - new String:time[50]; - new String:authid[50]; + char arg_string[256]; + char time[50]; + char authid[50]; GetCmdArgString(arg_string, sizeof(arg_string)); - new len, total_len; + int len, total_len; /* Get time */ if ((len = BreakString(arg_string, time, sizeof(time))) == -1) @@ -284,7 +287,7 @@ public Action:Command_AddBan(client, args) } /* Verify steamid */ - new bool:idValid = false; + bool idValid = false; if (!strncmp(authid, "STEAM_", 6) && authid[7] == ':') idValid = true; else if (!strncmp(authid, "[U:", 3)) @@ -296,7 +299,7 @@ public Action:Command_AddBan(client, args) return Plugin_Handled; } - new minutes = StringToInt(time); + int minutes = StringToInt(time); LogAction(client, -1, @@ -317,7 +320,7 @@ public Action:Command_AddBan(client, args) return Plugin_Handled; } -public Action:Command_Unban(client, args) +public Action Command_Unban(int client, int args) { if (args < 1) { @@ -325,12 +328,12 @@ public Action:Command_Unban(client, args) return Plugin_Handled; } - decl String:arg[50]; + char arg[50]; GetCmdArgString(arg, sizeof(arg)); ReplaceString(arg, sizeof(arg), "\"", ""); - new ban_flags; + int ban_flags; if (IsCharNumeric(arg[0])) { ban_flags |= BANFLAG_IP; @@ -348,7 +351,7 @@ public Action:Command_Unban(client, args) return Plugin_Handled; } -public Action:Command_AbortBan(client, args) +public Action Command_AbortBan(int client, int args) { if(!CheckCommandAccess(client, "sm_ban", ADMFLAG_BAN)) { @@ -368,7 +371,7 @@ public Action:Command_AbortBan(client, args) return Plugin_Handled; } -public Action:OnClientSayCommand(client, const String:command[], const String:sArgs[]) +public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) { if(g_IsWaitingForChatReason[client]) { diff --git a/plugins/basebans/ban.sp b/plugins/basebans/ban.sp index 2b4fdfc1..70573053 100644 --- a/plugins/basebans/ban.sp +++ b/plugins/basebans/ban.sp @@ -31,9 +31,9 @@ * Version: $Id$ */ -PrepareBan(client, target, time, const String:reason[]) +void PrepareBan(int client, int target, int time, const char[] reason) { - new originalTarget = GetClientOfUserId(g_BanTargetUserId[client]); + int originalTarget = GetClientOfUserId(g_BanTargetUserId[client]); if (originalTarget != target) { @@ -49,7 +49,7 @@ PrepareBan(client, target, time, const String:reason[]) return; } - new String:name[MAX_NAME_LENGTH]; + char name[MAX_NAME_LENGTH]; GetClientName(target, name, sizeof(name)); if (!time) @@ -81,11 +81,11 @@ PrepareBan(client, target, time, const String:reason[]) } } -DisplayBanTargetMenu(client) +void DisplayBanTargetMenu(int client) { - Menu menu = CreateMenu(MenuHandler_BanPlayerList); + Menu menu = new Menu(MenuHandler_BanPlayerList); - decl String:title[100]; + char title[100]; Format(title, sizeof(title), "%T:", "Ban player", client); menu.SetTitle(title); menu.ExitBackButton = true; @@ -95,11 +95,11 @@ DisplayBanTargetMenu(client) menu.Display(client, MENU_TIME_FOREVER); } -DisplayBanTimeMenu(client) +void DisplayBanTimeMenu(int client) { - Menu menu = CreateMenu(MenuHandler_BanTimeList); + Menu menu = new Menu(MenuHandler_BanTimeList); - decl String:title[100]; + char title[100]; Format(title, sizeof(title), "%T: %N", "Ban player", client, g_BanTarget[client]); menu.SetTitle(title); menu.ExitBackButton = true; @@ -115,11 +115,11 @@ DisplayBanTimeMenu(client) menu.Display(client, MENU_TIME_FOREVER); } -DisplayBanReasonMenu(client) +void DisplayBanReasonMenu(int client) { - Menu menu = CreateMenu(MenuHandler_BanReasonList); + Menu menu = new Menu(MenuHandler_BanReasonList); - decl String:title[100]; + char title[100]; Format(title, sizeof(title), "%T: %N", "Ban reason", client, g_BanTarget[client]); menu.SetTitle(title); menu.ExitBackButton = true; @@ -128,8 +128,8 @@ DisplayBanReasonMenu(client) menu.AddItem("", "Custom reason (type in chat)"); //Loading configurable entries from the kv-file - decl String:reasonName[100]; - decl String:reasonFull[255]; + char reasonName[100]; + char reasonFull[255]; //Iterate through the kv-file g_hKvBanReasons.GotoFirstSubKey(false); @@ -149,12 +149,12 @@ DisplayBanReasonMenu(client) menu.Display(client, MENU_TIME_FOREVER); } -public AdminMenu_Ban(Handle:topmenu, - TopMenuAction:action, - TopMenuObject:object_id, - param, - String:buffer[], - maxlength) +public void AdminMenu_Ban(Handle topmenu, + TopMenuAction action, + TopMenuObject object_id, + int param, + char[] buffer, + int maxlength) { //Reset chat reason first g_IsWaitingForChatReason[param] = false; @@ -169,7 +169,7 @@ public AdminMenu_Ban(Handle:topmenu, } } -public MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, int param2) +public int MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, int param2) { if (action == MenuAction_End) { @@ -192,7 +192,7 @@ public MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, int p } else { - decl String:info[64]; + char info[64]; menu.GetItem(param2, info, sizeof(info)); @@ -201,7 +201,7 @@ public MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, int p } } -public MenuHandler_BanPlayerList(Menu menu, MenuAction action, int param1, int param2) +public int MenuHandler_BanPlayerList(Menu menu, MenuAction action, int param1, int param2) { if (action == MenuAction_End) { @@ -216,8 +216,8 @@ public MenuHandler_BanPlayerList(Menu menu, MenuAction action, int param1, int p } 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); @@ -239,7 +239,7 @@ public MenuHandler_BanPlayerList(Menu menu, MenuAction action, int param1, int p } } -public MenuHandler_BanTimeList(Menu menu, MenuAction action, int param1, int param2) +public int MenuHandler_BanTimeList(Menu menu, MenuAction action, int param1, int param2) { if (action == MenuAction_End) { @@ -254,7 +254,7 @@ public MenuHandler_BanTimeList(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_Select) { - decl String:info[32]; + char info[32]; menu.GetItem(param2, info, sizeof(info)); g_BanTime[param1] = StringToInt(info); @@ -264,7 +264,7 @@ public MenuHandler_BanTimeList(Menu menu, MenuAction action, int param1, int par } -public Action:Command_Ban(client, args) +public Action Command_Ban(int client, int args) { if (args < 2) { @@ -272,20 +272,20 @@ public Action:Command_Ban(client, args) return Plugin_Handled; } - decl len, next_len; - decl String:Arguments[256]; + int len, next_len; + char Arguments[256]; GetCmdArgString(Arguments, sizeof(Arguments)); - decl String:arg[65]; + char arg[65]; len = BreakString(Arguments, arg, sizeof(arg)); - new target = FindTarget(client, arg, true); + int target = FindTarget(client, arg, true); if (target == -1) { return Plugin_Handled; } - decl String:s_time[12]; + char s_time[12]; if ((next_len = BreakString(Arguments[len], s_time, sizeof(s_time))) != -1) { len += next_len; @@ -296,7 +296,7 @@ public Action:Command_Ban(client, args) Arguments[0] = '\0'; } - new time = StringToInt(s_time); + int time = StringToInt(s_time); g_BanTargetUserId[client] = GetClientUserId(target); diff --git a/plugins/include/banning.inc b/plugins/include/banning.inc index df5619eb..d98230e6 100644 --- a/plugins/include/banning.inc +++ b/plugins/include/banning.inc @@ -54,13 +54,13 @@ * @return Plugin_Handled to block the actual server banning. * Kicking will still occur. */ -forward Action:OnBanClient(client, - time, - flags, - const String:reason[], - const String:kick_message[], - const String:command[], - any:source); +forward Action OnBanClient(int client, + int time, + int flags, + const char[] reason, + const char[] kick_message, + const char[] command, + any source); /** * Called for calls to BanIdentity() with a non-empty command. @@ -73,12 +73,12 @@ forward Action:OnBanClient(client, * @param source Source value passed via BanIdentity(). * @return Plugin_Handled to block the actual server banning. */ -forward Action:OnBanIdentity(const String:identity[], - time, - flags, - const String:reason[], - const String:command[], - any:source); +forward Action OnBanIdentity(const char[] identity, + int time, + int flags, + const char[] reason, + const char[] command, + any source); /** * Called for calls to RemoveBan() with a non-empty command. @@ -89,10 +89,10 @@ forward Action:OnBanIdentity(const String:identity[], * @param source Source value passed via BanIdentity(). * @return Plugin_Handled to block the actual server banning. */ -forward Action:OnRemoveBan(const String:identity[], - flags, - const String:command[], - any:source); +forward Action OnRemoveBan(const char[] identity, + int flags, + const char[] command, + any source); /** * Bans a client. @@ -111,13 +111,13 @@ forward Action:OnRemoveBan(const String:identity[], * @return True on success, false on failure. * @error Invalid client index or client not in game. */ -native bool:BanClient(client, - time, - flags, - const String:reason[], - const String:kick_message[]="", - const String:command[]="", - any:source=0); +native bool BanClient(int client, + int time, + int flags, + const char[] reason, + const char[] kick_message="", + const char[] command="", + any source=0); /** * Bans an identity (either an IP address or auth string). @@ -132,12 +132,12 @@ native bool:BanClient(client, * index of any sort (not actually checked by Core). * @return True on success, false on failure. */ -native bool:BanIdentity(const String:identity[], - time, - flags, - const String:reason[], - const String:command[]="", - any:source=0); +native bool BanIdentity(const char[] identity, + int time, + int flags, + const char[] reason, + const char[] command="", + any source=0); /** * Removes a ban that was written to the server (either in memory or on disk). @@ -150,8 +150,7 @@ native bool:BanIdentity(const String:identity[], * index of any sort (not actually checked by Core). * @return True on success, false on failure. */ -native bool:RemoveBan(const String:identity[], - flags, - const String:command[]="", - any:source=0); - +native bool RemoveBan(const char[] identity, + int flags, + const char[] command="", + any source=0); diff --git a/plugins/sql-admin-manager.sp b/plugins/sql-admin-manager.sp index b7429622..621a3a26 100644 --- a/plugins/sql-admin-manager.sp +++ b/plugins/sql-admin-manager.sp @@ -36,12 +36,14 @@ #include +#pragma newdecls required + #define CURRENT_SCHEMA_VERSION 1409 #define SCHEMA_UPGRADE_1 1409 -new current_version[4] = {1, 0, 0, CURRENT_SCHEMA_VERSION}; +int current_version[4] = {1, 0, 0, CURRENT_SCHEMA_VERSION}; -public Plugin:myinfo = +public Plugin myinfo = { name = "SQL Admin Manager", author = "AlliedModders LLC", @@ -50,7 +52,7 @@ public Plugin:myinfo = url = "http://www.sourcemod.net/" }; -public OnPluginStart() +public void OnPluginStart() { LoadTranslations("common.phrases"); LoadTranslations("sqladmins.phrases"); @@ -84,9 +86,9 @@ Database Connect() return db; } -CreateMySQL(client, Handle:db) +void CreateMySQL(int client, Database db) { - new String:queries[7][] = + char queries[7][] = { "CREATE TABLE sm_admins (id int(10) unsigned NOT NULL auto_increment, authtype enum('steam','name','ip') NOT NULL, identity varchar(65) NOT NULL, password varchar(65), flags varchar(30) NOT NULL, name varchar(65) NOT NULL, immunity int(10) unsigned NOT NULL, PRIMARY KEY (id))", "CREATE TABLE sm_groups (id int(10) unsigned NOT NULL auto_increment, flags varchar(30) NOT NULL, name varchar(120) NOT NULL, immunity_level int(1) unsigned NOT NULL, PRIMARY KEY (id))", @@ -97,7 +99,7 @@ CreateMySQL(client, Handle:db) "CREATE TABLE IF NOT EXISTS sm_config (cfg_key varchar(32) NOT NULL, cfg_value varchar(255) NOT NULL, PRIMARY KEY (cfg_key))" }; - for (new i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) { if (!DoQuery(client, db, queries[i])) { @@ -105,7 +107,7 @@ CreateMySQL(client, Handle:db) } } - decl String:query[256]; + char query[256]; Format(query, sizeof(query), "INSERT INTO sm_config (cfg_key, cfg_value) VALUES ('admin_version', '1.0.0.%d') ON DUPLICATE KEY UPDATE cfg_value = '1.0.0.%d'", @@ -120,9 +122,9 @@ CreateMySQL(client, Handle:db) ReplyToCommand(client, "[SM] Admin tables have been created."); } -CreateSQLite(client, Handle:db) +void CreateSQLite(int client, Database db) { - new String:queries[7][] = + char queries[7][] = { "CREATE TABLE sm_admins (id INTEGER PRIMARY KEY AUTOINCREMENT, authtype varchar(16) NOT NULL CHECK(authtype IN ('steam', 'ip', 'name')), identity varchar(65) NOT NULL, password varchar(65), flags varchar(30) NOT NULL, name varchar(65) NOT NULL, immunity INTEGER NOT NULL)", "CREATE TABLE sm_groups (id INTEGER PRIMARY KEY AUTOINCREMENT, flags varchar(30) NOT NULL, name varchar(120) NOT NULL, immunity_level INTEGER NOT NULL)", @@ -133,7 +135,7 @@ CreateSQLite(client, Handle:db) "CREATE TABLE IF NOT EXISTS sm_config (cfg_key varchar(32) NOT NULL, cfg_value varchar(255) NOT NULL, PRIMARY KEY (cfg_key))" }; - for (new i = 0; i < 7; i++) + for (int i = 0; i < 7; i++) { if (!DoQuery(client, db, queries[i])) { @@ -141,7 +143,7 @@ CreateSQLite(client, Handle:db) } } - decl String:query[256]; + char query[256]; Format(query, sizeof(query), "REPLACE INTO sm_config (cfg_key, cfg_value) VALUES ('admin_version', '1.0.0.%d')", @@ -155,7 +157,7 @@ CreateSQLite(client, Handle:db) ReplyToCommand(client, "[SM] Admin tables have been created."); } -public Action:Command_CreateTables(args) +public Action Command_CreateTables(int args) { int client = 0; Database db = Connect(); @@ -182,7 +184,7 @@ public Action:Command_CreateTables(args) return Plugin_Handled; } -bool:GetUpdateVersion(client, Handle:db, versions[4]) +bool GetUpdateVersion(int client, Database db, int versions[4]) { char query[256]; DBResultSet rs; @@ -201,7 +203,7 @@ bool:GetUpdateVersion(client, Handle:db, versions[4]) char version_numbers[4][12]; if (ExplodeString(version_string, ".", version_numbers, 4, 12) == 4) { - for (new i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { versions[i] = StringToInt(version_numbers[i]); } @@ -226,7 +228,7 @@ bool:GetUpdateVersion(client, Handle:db, versions[4]) return true; } -UpdateSQLite(client, Database db) +void UpdateSQLite(int client, Database db) { char query[512]; DBResultSet rs; @@ -242,7 +244,7 @@ UpdateSQLite(client, Database db) delete rs; - new versions[4]; + int versions[4]; if (found) { if (!GetUpdateVersion(client, db, versions)) @@ -268,7 +270,7 @@ UpdateSQLite(client, Database db) "CREATE TABLE IF NOT EXISTS sm_config (cfg_key varchar(32) NOT NULL, cfg_value varchar(255) NOT NULL, PRIMARY KEY (cfg_key))" }; - for (new i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { if (!DoQuery(client, db, queries[i])) { @@ -292,7 +294,7 @@ UpdateSQLite(client, Database db) ReplyToCommand(client, "[SM] Your tables are now up to date."); } -UpdateMySQL(client, Database db) +void UpdateMySQL(int client, Database db) { char query[512]; DBResultSet rs; @@ -316,7 +318,7 @@ UpdateMySQL(client, Database db) } delete rs; - new versions[4]; + int versions[4]; if (found && !GetUpdateVersion(client, db, versions)) { @@ -338,7 +340,7 @@ UpdateMySQL(client, Database db) "ALTER TABLE sm_groups DROP immunity" }; - for (new i = 0; i < 6; i++) + for (int i = 0; i < 6; i++) { if (!DoQuery(client, db, queries[i])) { @@ -361,9 +363,9 @@ UpdateMySQL(client, Database db) ReplyToCommand(client, "[SM] Your tables are now up to date."); } -public Action:Command_UpdateTables(args) +public Action Command_UpdateTables(int args) { - new client = 0; + int client = 0; Database db = Connect(); if (db == null) { @@ -388,7 +390,7 @@ public Action:Command_UpdateTables(args) return Plugin_Handled; } -public Action:Command_SetAdminGroups(client, args) +public Action Command_SetAdminGroups(int client, int args) { if (args < 2) { @@ -481,7 +483,7 @@ public Action:Command_SetAdminGroups(client, args) char name[80]; int inherit_order = 0; - for (new i=3; i<=args; i++) + for (int i=3; i<=args; i++) { GetCmdArg(i, name, sizeof(name)); @@ -490,7 +492,7 @@ public Action:Command_SetAdminGroups(client, args) { ReplyToCommand(client, "[SM] %t", "SQL Group X not found", name); } else { - new gid = SQL_FetchInt(hFindQuery, 0); + int gid = SQL_FetchInt(hFindQuery, 0); hAddQuery.BindInt(0, gid); hAddQuery.BindInt(1, ++inherit_order); @@ -516,7 +518,7 @@ public Action:Command_SetAdminGroups(client, args) return Plugin_Handled; } -public Action:Command_DelGroup(client, args) +public Action Command_DelGroup(int client, int args) { if (args < 1) { @@ -600,7 +602,7 @@ public Action:Command_DelGroup(client, args) return Plugin_Handled; } -public Action:Command_AddGroup(client, args) +public Action Command_AddGroup(int client, int args) { if (args < 2) { @@ -608,10 +610,10 @@ public Action:Command_AddGroup(client, args) return Plugin_Handled; } - new immunity; + int immunity; if (args >= 3) { - new String:arg3[32]; + char arg3[32]; GetCmdArg(3, arg3, sizeof(arg3)); if (!StringToIntEx(arg3, immunity)) { @@ -673,7 +675,7 @@ public Action:Command_AddGroup(client, args) return Plugin_Handled; } -public Action:Command_DelAdmin(client, args) +public Action Command_DelAdmin(int client, int args) { if (args < 2) { @@ -751,7 +753,7 @@ public Action:Command_DelAdmin(client, args) return Plugin_Handled; } -public Action:Command_AddAdmin(client, args) +public Action Command_AddAdmin(int client, int args) { if (args < 4) { @@ -854,11 +856,11 @@ public Action:Command_AddAdmin(client, args) return Plugin_Handled; } -stock bool:DoQuery(client, Handle:db, const String:query[]) +stock bool DoQuery(int client, Database db, const char[] query) { if (!SQL_FastQuery(db, query)) { - decl String:error[255]; + char error[255]; SQL_GetError(db, error, sizeof(error)); LogError("Query failed: %s", error); LogError("Query dump: %s", query); @@ -869,9 +871,9 @@ stock bool:DoQuery(client, Handle:db, const String:query[]) return true; } -stock Action:DoError(client, Handle:db, const String:query[], const String:msg[]) +stock Action DoError(int client, Database db, const char[] query, const char[] msg) { - decl String:error[255]; + char error[255]; SQL_GetError(db, error, sizeof(error)); LogError("%s: %s", msg, error); LogError("Query dump: %s", query); @@ -880,7 +882,7 @@ stock Action:DoError(client, Handle:db, const String:query[], const String:msg[] return Plugin_Handled; } -stock Action:DoStmtError(client, Handle:db, const String:query[], const String:error[], const String:msg[]) +stock Action DoStmtError(int client, Database db, const char[] query, const char[] error, const char[] msg) { LogError("%s: %s", msg, error); LogError("Query dump: %s", query); @@ -888,4 +890,3 @@ stock Action:DoStmtError(client, Handle:db, const String:query[], const String:e ReplyToCommand(client, "[SM] %t", "Failed to query database"); return Plugin_Handled; } -