From 88e880d75b67c68e0bc5dcedafde0d5536726442 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:38:36 +0545 Subject: [PATCH 01/11] Update kento_rankme.sp --- scripting/kento_rankme.sp | 169 ++++++++++++++++++++------------------ 1 file changed, 89 insertions(+), 80 deletions(-) diff --git a/scripting/kento_rankme.sp b/scripting/kento_rankme.sp index 67e37f2..f9f34d0 100644 --- a/scripting/kento_rankme.sp +++ b/scripting/kento_rankme.sp @@ -1,10 +1,10 @@ #pragma semicolon 1 -#define PLUGIN_VERSION "3.0.3.Kento.33.3" +#define PLUGIN_VERSION "3.4" #include #include -#include +#include #include #include #include @@ -21,8 +21,8 @@ #define SENDER_WORLD 0 #define MAX_LENGTH_MENU 470 -static const char g_sSqliteCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam VARCHAR(40) NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp_silencer NUMERIC,p250 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,nova NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galilar NUMERIC,ak47 NUMERIC,scar20 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC)"; -static const char g_sMysqlCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam TEXT, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp_silencer NUMERIC,p250 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,nova NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galilar NUMERIC,ak47 NUMERIC,scar20 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; +static const char g_sSqliteCreate[] = "CREATE TABLE IF NOT EXISTS` % s`(id INTEGER PRIMARY KEY, steam VARCHAR(40)NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC, knife NUMERIC, glock NUMERIC, hkp2000 NUMERIC, usp NUMERIC, p250 NUMERIC, p228 NUMERIC, deagle NUMERIC, elite NUMERIC, fiveseven NUMERIC, tec9 NUMERIC, cz75a NUMERIC, revolver NUMERIC, m3 NUMERIC, xm1014 NUMERIC, mag7 NUMERIC, sawedoff NUMERIC, bizon NUMERIC, tmp NUMERIC, mac10 NUMERIC, mp9 NUMERIC, mp5navy NUMERIC, mp7 NUMERIC, ump45 NUMERIC, p90 NUMERIC, galil NUMERIC, ak47 NUMERIC, scar20 NUMERIC, scout NUMERIC, sg552 NUMERIC, famas NUMERIC, m4a1 NUMERIC, m4a1_silencer NUMERIC, aug NUMERIC, ssg08 NUMERIC, sg556 NUMERIC, awp NUMERIC, sg550 NUMERIC, g3sg1 NUMERIC, m249 NUMERIC, negev NUMERIC, hegrenade NUMERIC, flashbang NUMERIC, smokegrenade NUMERIC, inferno NUMERIC, decoy NUMERIC, taser NUMERIC, mp5sd NUMERIC, breachcharge NUMERIC, head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC, c4_planted NUMERIC, c4_exploded NUMERIC, c4_defused NUMERIC, ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC)"; +static const char g_sMysqlCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam VARCHAR(40) NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp NUMERIC,p250 NUMERIC,p228 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,m3 NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,tmp NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp5navy NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galil NUMERIC,ak47 NUMERIC,scar20 NUMERIC,scout NUMERIC,sg552 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,sg550 NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; static const char g_sSqlInsert[] = "INSERT INTO `%s` VALUES (NULL,'%s','%s','%s','%d','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');"; /* SM1.9 Fix */ @@ -42,8 +42,8 @@ static const char g_sSqlRemoveDuplicateIpSQLite[] = "delete from `%s` where `%s` static const char g_sSqlRemoveDuplicateMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.steam=vtable.steam);"; static const char g_sSqlRemoveDuplicateNameMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.name=vtable.name);"; static const char g_sSqlRemoveDuplicateIpMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.ip=vtable.ip);"; -stock const char g_sWeaponsNamesGame[42][] = { "knife", "glock", "hkp2000", "usp_silencer", "p250", "deagle", "elite", "fiveseven", "tec9", "cz75a", "revolver", "nova", "xm1014", "mag7", "sawedoff", "bizon", "mac10", "mp9", "mp7", "ump45", "p90", "galilar", "ak47", "scar20", "famas", "m4a1", "m4a1_silencer", "aug", "ssg08", "sg556", "awp", "g3sg1", "m249", "negev", "hegrenade", "flashbang", "smokegrenade", "inferno", "decoy", "taser", "mp5sd", "breachcharge"}; -stock const char g_sWeaponsNamesFull[42][] = { "Knife", "Glock", "P2000", "USP-S", "P250", "Desert Eagle", "Dual Berettas", "Five-Seven", "Tec 9", "CZ75-Auto", "R8 Revolver", "Nova", "XM1014", "Mag 7", "Sawed-off", "PP-Bizon", "MAC-10", "MP9", "MP7", "UMP45", "P90", "Galil AR", "AK-47", "SCAR-20", "Famas", "M4A4", "M4A1-S", "AUG", "SSG 08", "SG 553", "AWP", "G3SG1", "M249", "Negev", "HE Grenade", "Flashbang", "Smoke Grenade", "Inferno", "Decoy", "Zeus x27", "MP5-SD", "Breach Charges"}; +stock const char g_sWeaponsNamesGame[48][] = { "knife", "glock", "hkp2000", "usp", "p250", "p228", "deagle", "elite", "fiveseven", "tec9", "cz75a", "revolver", "m3", "xm1014", "mag7", "sawedoff", "bizon", "tmp", "mac10", "mp9", "mp5navy", "mp7", "ump45", "p90", "galil", "ak47", "scar20", "scout", "sg552", "famas", "m4a1", "m4a1_silencer", "aug", "ssg08", "sg556", "sg550", "awp", "g3sg1", "m249", "negev", "hegrenade", "flashbang", "smokegrenade", "inferno", "decoy", "taser", "mp5sd", "breachcharge"}; +stock const char g_sWeaponsNamesFull[48][] = { "Knife", "Glock 19", "P2000", "Heckler & Koch USP45 Tactical", "P250", "SIG-Sauer P228", "Desert Eagle", "Dual Elites", "Five-Seven", "Tec 9", "CZ75-Auto", "R8 Revolver", "Benelli M3 Super 90", "Benelli M4 Super 90", "Mag 7", "Sawed-off", "PP-Bizon", "Steyr TMP", "Ingram MAC-10", "MP9", "Heckler & Koch MP5N", "MP7", "Heckler & Koch UMP45", "Fabrique Nationale P90", "IMI Galil ARM", "AK-47", "SCAR-20", "Steyr Scout", "SIG SG 552", "FAMAS F1", "M4A4", "M4A1-S", "Steyr AUG A1", "SSG 08", "SG 553", "SIG SG 550 SR", "Accuracy International Arctic Warfare Super Magnum", "Heckler & Koch G3SG/1", "FN M249-E2 SAW", "Negev", "HE Grenade", "Flashbang", "Smoke Grenade", "Inferno", "Decoy", "Zeus x27", "MP5-SD", "Breach Charges"}; char g_sSQLTable[200]; Handle g_hStatsDb; @@ -81,10 +81,10 @@ char MSG[64]; public Plugin myinfo = { name = "RankMe", - author = "lok1, Scooby, Kento, pracc, Kxnrl, CrazyHackGUT", - description = "Improved RankMe for CSGO", + author = "lok1, Scooby, Kento, pracc, Kxnrl, CrazyHackGUT, +SyntX34", + description = "Improved RankMe for CSS/CSGO/CS2", version = PLUGIN_VERSION, - url = "https://github.com/rogeraabbccdd/Kento-Rankme" + url = "" }; public void OnPluginStart() { @@ -117,7 +117,10 @@ public void OnPluginStart() { RegAdminCmd("sm_resetrank", CMD_ResetRank, ADMFLAG_ROOT, "RankMe: Resets the rank of a player"); RegAdminCmd("sm_rankme_remove_duplicate", CMD_Duplicate, ADMFLAG_ROOT, "RankMe: Removes the duplicated rows on the database"); RegAdminCmd("sm_rankpurge", CMD_Purge, ADMFLAG_ROOT, "RankMe: Purges from the rank players that didn't connected for X days"); - RegAdminCmd("sm_resetrank_all", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); + RegAdminCmd("sm_resetallrank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); + RegAdminCmd("sm_restartrank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); + RegAdminCmd("sm_eraserank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); + RegAdminCmd("sm_wiperank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); // PLAYER COMMANDS RegConsoleCmd("sm_session", CMD_Session, "RankMe: Shows the stats of your current session"); @@ -194,9 +197,9 @@ public void DB_Connect(bool firstload) { g_cvarSQLTable.GetString(g_sSQLTable, sizeof(g_sSQLTable)); char sError[256]; if (g_bMysql) { - g_hStatsDb = SQL_Connect("rankme", false, sError, sizeof(sError)); + g_hStatsDb = SQL_Connect("kento_rankme", false, sError, sizeof(sError)); } else { - g_hStatsDb = SQLite_UseDatabase("rankme", sError, sizeof(sError)); + g_hStatsDb = SQLite_UseDatabase("kento_rankme", sError, sizeof(sError)); } if (g_hStatsDb == INVALID_HANDLE) @@ -1580,79 +1583,85 @@ public void SQL_LoadPlayerCallback(Handle owner, Handle hndl, const char[] error g_aWeapons[client].KNIFE = SQL_FetchInt(hndl, 17); g_aWeapons[client].GLOCK = SQL_FetchInt(hndl, 18); g_aWeapons[client].HKP2000 = SQL_FetchInt(hndl, 19); - g_aWeapons[client].USP_SILENCER = SQL_FetchInt(hndl, 20); + g_aWeapons[client].USP = SQL_FetchInt(hndl, 20); g_aWeapons[client].P250 = SQL_FetchInt(hndl, 21); - g_aWeapons[client].DEAGLE = SQL_FetchInt(hndl, 22); - g_aWeapons[client].ELITE = SQL_FetchInt(hndl, 23); - g_aWeapons[client].FIVESEVEN = SQL_FetchInt(hndl, 24); - g_aWeapons[client].TEC9 = SQL_FetchInt(hndl, 25); - g_aWeapons[client].CZ75A = SQL_FetchInt(hndl, 26); - g_aWeapons[client].REVOLVER = SQL_FetchInt(hndl, 27); - g_aWeapons[client].NOVA = SQL_FetchInt(hndl, 28); - g_aWeapons[client].XM1014 = SQL_FetchInt(hndl, 29); - g_aWeapons[client].MAG7 = SQL_FetchInt(hndl, 30); - g_aWeapons[client].SAWEDOFF = SQL_FetchInt(hndl, 31); - g_aWeapons[client].BIZON = SQL_FetchInt(hndl, 32); - g_aWeapons[client].MAC10 = SQL_FetchInt(hndl, 33); - g_aWeapons[client].MP9 = SQL_FetchInt(hndl, 34); - g_aWeapons[client].MP7 = SQL_FetchInt(hndl, 35); - g_aWeapons[client].UMP45 = SQL_FetchInt(hndl, 36); - g_aWeapons[client].P90 = SQL_FetchInt(hndl, 37); - g_aWeapons[client].GALILAR = SQL_FetchInt(hndl, 38); - g_aWeapons[client].AK47 = SQL_FetchInt(hndl, 39); - g_aWeapons[client].SCAR20 = SQL_FetchInt(hndl, 40); - g_aWeapons[client].FAMAS = SQL_FetchInt(hndl, 41); - g_aWeapons[client].M4A1 = SQL_FetchInt(hndl, 42); - g_aWeapons[client].M4A1_SILENCER = SQL_FetchInt(hndl, 43); - g_aWeapons[client].AUG = SQL_FetchInt(hndl, 44); - g_aWeapons[client].SSG08 = SQL_FetchInt(hndl, 45); - g_aWeapons[client].SG556 = SQL_FetchInt(hndl, 46); - g_aWeapons[client].AWP = SQL_FetchInt(hndl, 47); - g_aWeapons[client].G3SG1 = SQL_FetchInt(hndl, 48); - g_aWeapons[client].M249 = SQL_FetchInt(hndl, 49); - g_aWeapons[client].NEGEV = SQL_FetchInt(hndl, 50); - g_aWeapons[client].HEGRENADE = SQL_FetchInt(hndl, 51); - g_aWeapons[client].FLASHBANG = SQL_FetchInt(hndl, 52); - g_aWeapons[client].SMOKEGRENADE = SQL_FetchInt(hndl, 53); - g_aWeapons[client].INFERNO = SQL_FetchInt(hndl, 54); - g_aWeapons[client].DECOY = SQL_FetchInt(hndl, 55); - g_aWeapons[client].TASER = SQL_FetchInt(hndl, 56); - g_aWeapons[client].MP5SD = SQL_FetchInt(hndl, 57); - g_aWeapons[client].BREACHCHARGE = SQL_FetchInt(hndl, 58); + g_aWeapons[client].P228 = SQL_FetchInt(hndl, 22); + g_aWeapons[client].DEAGLE = SQL_FetchInt(hndl, 23); + g_aWeapons[client].ELITE = SQL_FetchInt(hndl, 24); + g_aWeapons[client].FIVESEVEN = SQL_FetchInt(hndl, 25); + g_aWeapons[client].TEC9 = SQL_FetchInt(hndl, 26); + g_aWeapons[client].CZ75A = SQL_FetchInt(hndl, 27); + g_aWeapons[client].REVOLVER = SQL_FetchInt(hndl, 28); + g_aWeapons[client].M3 = SQL_FetchInt(hndl, 29); + g_aWeapons[client].XM1014 = SQL_FetchInt(hndl, 30); + g_aWeapons[client].MAG7 = SQL_FetchInt(hndl, 31); + g_aWeapons[client].SAWEDOFF = SQL_FetchInt(hndl, 32); + g_aWeapons[client].BIZON = SQL_FetchInt(hndl, 33); + g_aWeapons[client].TMP = SQL_FetchInt(hndl, 34); + g_aWeapons[client].MAC10 = SQL_FetchInt(hndl, 35); + g_aWeapons[client].MP9 = SQL_FetchInt(hndl, 36); + g_aWeapons[client].MP5NAVY = SQL_FetchInt(hndl, 37); + g_aWeapons[client].MP7 = SQL_FetchInt(hndl, 38); + g_aWeapons[client].UMP45 = SQL_FetchInt(hndl, 39); + g_aWeapons[client].P90 = SQL_FetchInt(hndl, 40); + g_aWeapons[client].GALIL = SQL_FetchInt(hndl, 41); + g_aWeapons[client].AK47 = SQL_FetchInt(hndl, 42); + g_aWeapons[client].SCAR20 = SQL_FetchInt(hndl, 43); + g_aWeapons[client].SCOUT = SQL_FetchInt(hndl, 44); + g_aWeapons[client].SG552 = SQL_FetchInt(hndl, 45); + g_aWeapons[client].FAMAS = SQL_FetchInt(hndl, 46); + g_aWeapons[client].M4A1 = SQL_FetchInt(hndl, 47); + g_aWeapons[client].M4A1_SILENCER = SQL_FetchInt(hndl, 48); + g_aWeapons[client].AUG = SQL_FetchInt(hndl, 49); + g_aWeapons[client].SSG08 = SQL_FetchInt(hndl, 50); + g_aWeapons[client].SG556 = SQL_FetchInt(hndl, 51); + g_aWeapons[client].SG550 = SQL_FetchInt(hndl, 52); + g_aWeapons[client].AWP = SQL_FetchInt(hndl, 53); + g_aWeapons[client].G3SG1 = SQL_FetchInt(hndl, 54); + g_aWeapons[client].M249 = SQL_FetchInt(hndl, 55); + g_aWeapons[client].NEGEV = SQL_FetchInt(hndl, 56); + g_aWeapons[client].HEGRENADE = SQL_FetchInt(hndl, 57); + g_aWeapons[client].FLASHBANG = SQL_FetchInt(hndl, 58); + g_aWeapons[client].SMOKEGRENADE = SQL_FetchInt(hndl, 59); + g_aWeapons[client].INFERNO = SQL_FetchInt(hndl, 60); + g_aWeapons[client].DECOY = SQL_FetchInt(hndl, 61); + g_aWeapons[client].TASER = SQL_FetchInt(hndl, 62); + g_aWeapons[client].MP5SD = SQL_FetchInt(hndl, 63); + g_aWeapons[client].BREACHCHARGE = SQL_FetchInt(hndl, 64); //ALL 8 Hitboxes - g_aHitBox[client].HEAD = SQL_FetchInt(hndl, 59); - g_aHitBox[client].CHEST = SQL_FetchInt(hndl, 60); - g_aHitBox[client].STOMACH = SQL_FetchInt(hndl, 61); - g_aHitBox[client].LEFT_ARM = SQL_FetchInt(hndl, 62); - g_aHitBox[client].RIGHT_ARM = SQL_FetchInt(hndl, 63); - g_aHitBox[client].LEFT_LEG = SQL_FetchInt(hndl, 64); - g_aHitBox[client].RIGHT_LEG = SQL_FetchInt(hndl, 65); + g_aHitBox[client].HEAD = SQL_FetchInt(hndl, 65); + g_aHitBox[client].CHEST = SQL_FetchInt(hndl, 66); + g_aHitBox[client].STOMACH = SQL_FetchInt(hndl, 67); + g_aHitBox[client].LEFT_ARM = SQL_FetchInt(hndl, 68); + g_aHitBox[client].RIGHT_ARM = SQL_FetchInt(hndl, 69); + g_aHitBox[client].LEFT_LEG = SQL_FetchInt(hndl, 70); + g_aHitBox[client].RIGHT_LEG = SQL_FetchInt(hndl, 71); // other stats - g_aStats[client].C4_PLANTED = SQL_FetchInt(hndl, 66); - g_aStats[client].C4_EXPLODED = SQL_FetchInt(hndl, 67); - g_aStats[client].C4_DEFUSED = SQL_FetchInt(hndl, 68); - g_aStats[client].CT_WIN = SQL_FetchInt(hndl, 69); - g_aStats[client].TR_WIN = SQL_FetchInt(hndl, 70); - g_aStats[client].HOSTAGES_RESCUED = SQL_FetchInt(hndl, 71); - g_aStats[client].VIP_KILLED = SQL_FetchInt(hndl, 72); - g_aStats[client].VIP_ESCAPED = SQL_FetchInt(hndl, 73); - g_aStats[client].VIP_PLAYED = SQL_FetchInt(hndl, 74); - g_aStats[client].MVP = SQL_FetchInt(hndl, 75); - g_aStats[client].DAMAGE = SQL_FetchInt(hndl, 76); - g_aStats[client].MATCH_WIN = SQL_FetchInt(hndl, 77); - g_aStats[client].MATCH_DRAW = SQL_FetchInt(hndl, 78); - g_aStats[client].MATCH_LOSE = SQL_FetchInt(hndl, 79); - g_aStats[client].FB = SQL_FetchInt(hndl, 80); - g_aStats[client].NS = SQL_FetchInt(hndl, 81); - g_aStats[client].NSD = SQL_FetchInt(hndl, 82); - g_aStats[client].SMOKE = SQL_FetchInt(hndl, 83); - g_aStats[client].BLIND = SQL_FetchInt(hndl, 84); - g_aStats[client].AF = SQL_FetchInt(hndl, 85); - g_aStats[client].ATF = SQL_FetchInt(hndl, 86); - g_aStats[client].ATK = SQL_FetchInt(hndl, 87); - g_aStats[client].WALL = SQL_FetchInt(hndl, 88); + g_aStats[client].C4_PLANTED = SQL_FetchInt(hndl, 72); + g_aStats[client].C4_EXPLODED = SQL_FetchInt(hndl, 73); + g_aStats[client].C4_DEFUSED = SQL_FetchInt(hndl, 74); + g_aStats[client].CT_WIN = SQL_FetchInt(hndl, 75); + g_aStats[client].TR_WIN = SQL_FetchInt(hndl, 76); + g_aStats[client].HOSTAGES_RESCUED = SQL_FetchInt(hndl, 77); + g_aStats[client].VIP_KILLED = SQL_FetchInt(hndl, 78); + g_aStats[client].VIP_ESCAPED = SQL_FetchInt(hndl, 79); + g_aStats[client].VIP_PLAYED = SQL_FetchInt(hndl, 80); + g_aStats[client].MVP = SQL_FetchInt(hndl, 81); + g_aStats[client].DAMAGE = SQL_FetchInt(hndl, 82); + g_aStats[client].MATCH_WIN = SQL_FetchInt(hndl, 83); + g_aStats[client].MATCH_DRAW = SQL_FetchInt(hndl, 84); + g_aStats[client].MATCH_LOSE = SQL_FetchInt(hndl, 85); + g_aStats[client].FB = SQL_FetchInt(hndl, 86); + g_aStats[client].NS = SQL_FetchInt(hndl, 87); + g_aStats[client].NSD = SQL_FetchInt(hndl, 88); + g_aStats[client].SMOKE = SQL_FetchInt(hndl, 89); + g_aStats[client].BLIND = SQL_FetchInt(hndl, 90); + g_aStats[client].AF = SQL_FetchInt(hndl, 91); + g_aStats[client].ATF = SQL_FetchInt(hndl, 92); + g_aStats[client].ATK = SQL_FetchInt(hndl, 93); + g_aStats[client].WALL = SQL_FetchInt(hndl, 94); } else { char query[10000]; char sEscapeName[MAX_NAME_LENGTH * 2 + 1]; From c2d1069e30625caa2e67ab7b1f950790ec9422b1 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:39:00 +0545 Subject: [PATCH 02/11] Update cmds.inc --- scripting/include/kento_rankme/cmds.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/include/kento_rankme/cmds.inc b/scripting/include/kento_rankme/cmds.inc index 19b2d6c..79e9c4a 100644 --- a/scripting/include/kento_rankme/cmds.inc +++ b/scripting/include/kento_rankme/cmds.inc @@ -377,7 +377,7 @@ public void SQL_TopCallback(Handle owner, Handle hndl, const char[] error, any D deaths=SQL_FetchInt(hndl,6); kdr = SQL_FetchFloat(hndl,5)/deaths; - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - KDR: %.2f\n",i+at,name,SQL_FetchInt(hndl,4),kdr); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - Kills: %d, Deaths: %d, KDR: %.2f\n",i+at,name,SQL_FetchInt(hndl,5),SQL_FetchInt(hndl,6),SQL_FetchInt(hndl,4),kdr); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); From f6a13c9ed8126e9e89e63fd20a4c89d2cb276ac5 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:41:47 +0545 Subject: [PATCH 03/11] Update natives.inc --- scripting/include/kento_rankme/natives.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripting/include/kento_rankme/natives.inc b/scripting/include/kento_rankme/natives.inc index 6187f63..6bb171f 100644 --- a/scripting/include/kento_rankme/natives.inc +++ b/scripting/include/kento_rankme/natives.inc @@ -9,7 +9,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("RankMe_GetHitbox", Native_GetHitbox); CreateNative("RankMe_IsPlayerLoaded", Native_IsPlayerLoaded); - RegPluginLibrary("rankme"); + RegPluginLibrary("rankme_advanced"); return APLRes_Success; } @@ -218,4 +218,4 @@ public int Native_IsPlayerLoaded(Handle plugin, int numParams) { int client = GetNativeCell(1); return OnDB[client]; -} \ No newline at end of file +} From d965aae5a5e5d3b444536c1dc3ffb5e39557feb4 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:42:50 +0545 Subject: [PATCH 04/11] Update rankme.inc --- scripting/include/kento_rankme/rankme.inc | 200 +++++++++++++--------- 1 file changed, 118 insertions(+), 82 deletions(-) diff --git a/scripting/include/kento_rankme/rankme.inc b/scripting/include/kento_rankme/rankme.inc index 674394d..5584b76 100644 --- a/scripting/include/kento_rankme/rankme.inc +++ b/scripting/include/kento_rankme/rankme.inc @@ -7,27 +7,32 @@ enum struct WEAPONS_ENUM{ int KNIFE; int GLOCK; int HKP2000; - int USP_SILENCER; + int USP; int P250; + int P228; int DEAGLE; int ELITE; int FIVESEVEN; int TEC9; int CZ75A; int REVOLVER; - int NOVA; + int M3; int XM1014; int MAG7; int SAWEDOFF; int BIZON; + int TMP; int MAC10; int MP9; + int MP5NAVY; int MP7; int UMP45; int P90; - int GALILAR; + int GALIL; int AK47; int SCAR20; + int SCOUT; + int SG552; int FAMAS; int M4A1; int M4A1_SILENCER; @@ -35,6 +40,7 @@ enum struct WEAPONS_ENUM{ int SSG08; int SG556; int AWP; + int SG550; int G3SG1; int M249; int NEGEV; @@ -50,71 +56,82 @@ enum struct WEAPONS_ENUM{ data[0] = this.KNIFE; data[1] = this.GLOCK; data[2] = this.HKP2000; - data[3] = this.USP_SILENCER; + data[3] = this.USP; data[4] = this.P250; - data[5] = this.DEAGLE; - data[6] = this.ELITE; - data[7] = this.FIVESEVEN; - data[8] = this.TEC9; - data[9] = this.CZ75A; - data[10] = this.REVOLVER; - data[11] = this.NOVA; - data[12] = this.XM1014; - data[13] = this.MAG7; - data[14] = this.SAWEDOFF; - data[15] = this.BIZON; - data[16] = this.MAC10; - data[17] = this.MP9; - data[18] = this.MP7; - data[19] = this.UMP45; - data[20] = this.P90; - data[21] = this.GALILAR; - data[22] = this.AK47; - data[23] = this.SCAR20; - data[24] = this.FAMAS; - data[25] = this.M4A1; - data[26] = this.M4A1_SILENCER; - data[27] = this.AUG; - data[28] = this.SSG08; - data[29] = this.SG556; - data[30] = this.AWP; - data[31] = this.G3SG1; - data[32] = this.M249; - data[33] = this.NEGEV; - data[34] = this.HEGRENADE; - data[35] = this.FLASHBANG; - data[36] = this.SMOKEGRENADE; - data[37] = this.INFERNO; - data[38] = this.DECOY; - data[39] = this.TASER; - data[40] = this.MP5SD; - data[41] = this.BREACHCHARGE; + data[5] = this.P228; + data[6] = this.DEAGLE; + data[7] = this.ELITE; + data[8] = this.FIVESEVEN; + data[9] = this.TEC9; + data[10] = this.CZ75A; + data[11] = this.REVOLVER; + data[12] = this.M3; + data[13] = this.XM1014; + data[14] = this.MAG7; + data[15] = this.SAWEDOFF; + data[16] = this.BIZON; + data[17] = this.TMP; + data[18] = this.MAC10; + data[19] = this.MP9; + data[20] = this.MP5NAVY; + data[21] = this.MP7; + data[22] = this.UMP45; + data[23] = this.P90; + data[24] = this.GALIL; + data[25] = this.AK47; + data[26] = this.SCAR20; + data[27] = this.SCOUT; + data[28] = this.SG552; + data[29] = this.FAMAS; + data[30] = this.M4A1; + data[31] = this.M4A1_SILENCER; + data[32] = this.AUG; + data[33] = this.SSG08; + data[34] = this.SG556; + data[35] = this.AWP; + data[36] = this.SG550; + data[37] = this.G3SG1; + data[38] = this.M249; + data[39] = this.NEGEV; + data[40] = this.HEGRENADE; + data[41] = this.FLASHBANG; + data[42] = this.SMOKEGRENADE; + data[43] = this.INFERNO; + data[44] = this.DECOY; + data[45] = this.TASER; + data[46] = this.MP5SD; + data[47] = this.BREACHCHARGE; } void Reset() { this.KNIFE = 0; this.GLOCK = 0; this.HKP2000 = 0; - this.USP_SILENCER = 0; + this.USP = 0; this.P250 = 0; + this.P228 = 0; this.DEAGLE = 0; this.ELITE = 0; this.FIVESEVEN = 0; this.TEC9 = 0; this.CZ75A = 0; this.REVOLVER = 0; - this.NOVA = 0; + this.M3 = 0; this.XM1014 = 0; this.MAG7 = 0; this.SAWEDOFF = 0; this.BIZON = 0; + this.TMP = 0; this.MAC10 = 0; this.MP9 = 0; + this.MP5NAVY = 0; this.MP7 = 0; this.UMP45 = 0; this.P90 = 0; - this.GALILAR = 0; + this.GALIL = 0; this.AK47 = 0; this.SCAR20 = 0; + this.SCOUT = 0; + this.SG552 = 0; this.FAMAS = 0; this.M4A1 = 0; this.M4A1_SILENCER = 0; @@ -122,6 +139,7 @@ enum struct WEAPONS_ENUM{ this.SSG08 = 0; this.SG556 = 0; this.AWP = 0; + this.SG550 = 0; this.G3SG1 = 0; this.M249 = 0; this.NEGEV = 0; @@ -146,120 +164,138 @@ enum struct WEAPONS_ENUM{ this.HKP2000++; } case 3: { - this.USP_SILENCER++; + this.USP++; } case 4: { this.P250++; } case 5: { - this.DEAGLE++; + this.P228++; } case 6: { - this.ELITE++; + this.DEAGLE++; } case 7: { - this.FIVESEVEN++; + this.ELITE++; } case 8: { - this.TEC9++; + this.FIVESEVEN++; } case 9: { - this.CZ75A++; + this.TEC9++; } case 10: { - this.REVOLVER++; + this.CZ75A++; } case 11: { - this.NOVA++; + this.REVOLVER++; } case 12: { - this.XM1014++; + this.M3++; } case 13: { - this.MAG7++; + this.XM1014++; } case 14: { - this.SAWEDOFF++; + this.MAG7++; } case 15: { - this.BIZON++; + this.SAWEDOFF++; } case 16: { - this.MAC10++; + this.BIZON++; } case 17: { - this.MP9++; + this.TMP++; } case 18: { - this.MP7++; + this.MAC10++; } case 19: { - this.UMP45++; + this.MP9++; } case 20: { - this.P90++; + this.MP5NAVY++; } case 21: { - this.GALILAR++; + this.MP7++; } case 22: { - this.AK47++; + this.UMP45++; } case 23: { - this.SCAR20++; + this.P90++; } case 24: { - this.FAMAS++; + this.GALIL++; } case 25: { - this.M4A1++; + this.AK47++; } case 26: { - this.M4A1_SILENCER++; + this.SCAR20++; } case 27: { - this.AUG++; + this.SCOUT++; } case 28: { - this.SSG08++; + this.SG552++; } case 29: { - this.SG556++; + this.FAMAS++; } case 30: { - this.AWP++; + this.M4A1++; } case 31: { - this.G3SG1++; + this.M4A1_SILENCER++; } case 32: { - this.M249++; + this.AUG++; } case 33: { - this.NEGEV++; + this.SSG08++; } case 34: { - this.HEGRENADE++; + this.SG556++; } case 35: { - this.FLASHBANG++; + this.AWP++; } case 36: { - this.SMOKEGRENADE++; + this.SG550++; } case 37: { - this.INFERNO++; + this.G3SG1++; } case 38: { - this.DECOY++; + this.M249++; } case 39: { - this.TASER++; + this.NEGEV++; } case 40: { - this.MP5SD++; + this.HEGRENADE++; } case 41: { + this.FLASHBANG++; + } + case 42: { + this.SMOKEGRENADE++; + } + case 43: { + this.INFERNO++; + } + case 44: { + this.DECOY++; + } + case 45: { + this.TASER++; + } + case 46: { + this.MP5SD++; + } + case 47: { this.BREACHCHARGE++; } } @@ -527,4 +563,4 @@ forward Action RankMe_OnPlayerLoaded(int client); * @param client The client index of the player that has been saved * @noreturn **********************************************************************/ -forward Action RankMe_OnPlayerSaved(int client); \ No newline at end of file +forward Action RankMe_OnPlayerSaved(int client); From 7e34218db6671c9a504e7dd7e25138edf436ba18 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:24:03 +0545 Subject: [PATCH 05/11] Update cmds.inc --- scripting/include/kento_rankme/cmds.inc | 130 ++++++++++++------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/scripting/include/kento_rankme/cmds.inc b/scripting/include/kento_rankme/cmds.inc index 79e9c4a..fc81f1b 100644 --- a/scripting/include/kento_rankme/cmds.inc +++ b/scripting/include/kento_rankme/cmds.inc @@ -335,72 +335,72 @@ void ShowTOP(int client, int at){ } public void SQL_TopCallback(Handle owner, Handle hndl, const char[] error, any Datapack){ - if(hndl == INVALID_HANDLE) - { - LogError("[RankMe] Query Fail: %s", error); - PrintToServer(error); - return; - } - - ResetPack(Datapack); - int i; - int client = ReadPackCell(Datapack); - if(client == 0 || !IsClientInGame(client)) - return; - int at = ReadPackCell(Datapack); - CloseHandle(Datapack); - if(!SQL_HasResultSet(hndl) || SQL_GetRowCount(hndl) ==0){ - ShowTOP(client,g_TotalPlayers-9); - return; - } - char name[256]; - char temp[500]; - - Menu menu = CreateMenuEx(GetMenuStyleHandle(MenuStyle_Radio),MenuHandler_Top); - - float kdr; - Format(temp,sizeof(temp)," %T\n","Showing",client,at+1,at+10,g_TotalPlayers); - menu.SetTitle(""); - char sBuffer[200]; - while(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl)) - { - - i++; - - SQL_FetchString(hndl,2,name,sizeof(name)); - - - int deaths; - if(SQL_FetchInt(hndl,6) == 0) - deaths = 1; - else - deaths=SQL_FetchInt(hndl,6); - - kdr = SQL_FetchFloat(hndl,5)/deaths; - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - Kills: %d, Deaths: %d, KDR: %.2f\n",i+at,name,SQL_FetchInt(hndl,5),SQL_FetchInt(hndl,6),SQL_FetchInt(hndl,4),kdr); - - if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ - Format(temp,sizeof(temp),"%s%s",temp,sBuffer); - sBuffer="\0"; - } - } - Format(temp,sizeof(temp),"%s\n",temp); - menu.AddItem(temp,temp); - - - IntToString(at+i,temp,sizeof(temp)); - char temp1[20]; - Format(temp1,sizeof(temp1),"%T","Next",client); - if(i>9) - menu.AddItem(temp,temp1); - IntToString(at-i,temp,sizeof(temp)); - Format(temp1,sizeof(temp1),"%T","Back",client); - if(at+i-1 >9) - menu.AddItem(temp,temp1); - - menu.DisplayAt(client,at,MENU_TIME_FOREVER); + if(hndl == INVALID_HANDLE) + { + LogError("[RankMe] Query Fail: %s", error); + PrintToServer(error); + return; + } + + ResetPack(Datapack); + int client = ReadPackCell(Datapack); + if(client == 0 || !IsClientInGame(client)) + return; + + int at = ReadPackCell(Datapack); + CloseHandle(Datapack); + + if(!SQL_HasResultSet(hndl) || SQL_GetRowCount(hndl) == 0){ + ShowTOP(client, g_TotalPlayers - 9); + return; + } + + char name[256]; + char temp[500]; + Menu menu = CreateMenuEx(GetMenuStyleHandle(MenuStyle_Radio), MenuHandler_Top); + float kdr; + Format(temp, sizeof(temp), " %T\n", "Showing", client, at + 1, at + 5, g_TotalPlayers); // Show up to 5 players + + char sBuffer[200]; + int i = 0; // Initialize the counter here + while(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl) && i < 5) // Limit to 5 players + { + i++; + SQL_FetchString(hndl, 2, name, sizeof(name)); + + int deaths = SQL_FetchInt(hndl, 6); + if(deaths == 0) + deaths = 1; // Avoid division by zero + + kdr = SQL_FetchFloat(hndl, 5) / deaths; + Format(sBuffer, sizeof(sBuffer), "%d - %s (%d) - Kills: %d, Deaths: %d, Headshots: %d, KDR: %.2f\n", + i + at, name, SQL_FetchInt(hndl, 4), SQL_FetchInt(hndl, 5), + deaths, SQL_FetchInt(hndl, 12), kdr); + + if(strlen(temp) + strlen(sBuffer) < MAX_LENGTH_MENU){ + Format(temp, sizeof(temp), "%s%s", temp, sBuffer); + sBuffer[0] = '\0'; // Clear buffer + } + } + + Format(temp, sizeof(temp), "%s\n", temp); + menu.AddItem(temp, temp); + + // Only add next/back if applicable + IntToString(at + i, temp, sizeof(temp)); + char temp1[20]; + Format(temp1, sizeof(temp1), "%T", "Next", client); + if(i == 5) // Show next only if we have 5 players + menu.AddItem(temp, temp1); + IntToString(at - i, temp, sizeof(temp)); + Format(temp1, sizeof(temp1), "%T", "Back", client); + if(at + i - 1 > 5) // Show back if we have more than 5 in the previous pages + menu.AddItem(temp, temp1); + + menu.DisplayAt(client, at, MENU_TIME_FOREVER); } + public int MenuHandler_Top(Menu menu, MenuAction action, int param1, int param2){ if (action == MenuAction_Select) @@ -590,7 +590,7 @@ public void SQL_TopKillsCallback(Handle owner, Handle hndl, const char[] error, Menu menu = CreateMenuEx(GetMenuStyleHandle(MenuStyle_Radio),MenuHandler_TopKills); - Format(temp,sizeof(temp)," %T\n","Showing",client,at+1,at+10,g_TotalPlayers); + Format(temp,sizeof(temp)," %T\n","Showing",client,at+1,at+5,g_TotalPlayers); menu.SetTitle(""); char sBuffer[200]; while(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl)) From d2c906f1886895460c6c1946308fe872b2ac5513 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 10:28:26 +0545 Subject: [PATCH 06/11] Update kento_rankme.sp fixed weapon array --- scripting/kento_rankme.sp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/scripting/kento_rankme.sp b/scripting/kento_rankme.sp index f9f34d0..2b436e9 100644 --- a/scripting/kento_rankme.sp +++ b/scripting/kento_rankme.sp @@ -1,6 +1,6 @@ #pragma semicolon 1 -#define PLUGIN_VERSION "3.4" +#define PLUGIN_VERSION "3.3.1" #include #include @@ -19,14 +19,18 @@ #define CT 3 #define SENDER_WORLD 0 -#define MAX_LENGTH_MENU 470 +#define MAX_LENGTH_MENU 512 static const char g_sSqliteCreate[] = "CREATE TABLE IF NOT EXISTS` % s`(id INTEGER PRIMARY KEY, steam VARCHAR(40)NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC, knife NUMERIC, glock NUMERIC, hkp2000 NUMERIC, usp NUMERIC, p250 NUMERIC, p228 NUMERIC, deagle NUMERIC, elite NUMERIC, fiveseven NUMERIC, tec9 NUMERIC, cz75a NUMERIC, revolver NUMERIC, m3 NUMERIC, xm1014 NUMERIC, mag7 NUMERIC, sawedoff NUMERIC, bizon NUMERIC, tmp NUMERIC, mac10 NUMERIC, mp9 NUMERIC, mp5navy NUMERIC, mp7 NUMERIC, ump45 NUMERIC, p90 NUMERIC, galil NUMERIC, ak47 NUMERIC, scar20 NUMERIC, scout NUMERIC, sg552 NUMERIC, famas NUMERIC, m4a1 NUMERIC, m4a1_silencer NUMERIC, aug NUMERIC, ssg08 NUMERIC, sg556 NUMERIC, awp NUMERIC, sg550 NUMERIC, g3sg1 NUMERIC, m249 NUMERIC, negev NUMERIC, hegrenade NUMERIC, flashbang NUMERIC, smokegrenade NUMERIC, inferno NUMERIC, decoy NUMERIC, taser NUMERIC, mp5sd NUMERIC, breachcharge NUMERIC, head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC, c4_planted NUMERIC, c4_exploded NUMERIC, c4_defused NUMERIC, ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC)"; static const char g_sMysqlCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam VARCHAR(40) NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp NUMERIC,p250 NUMERIC,p228 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,m3 NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,tmp NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp5navy NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galil NUMERIC,ak47 NUMERIC,scar20 NUMERIC,scout NUMERIC,sg552 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,sg550 NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; -static const char g_sSqlInsert[] = "INSERT INTO `%s` VALUES (NULL,'%s','%s','%s','%d','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');"; +static const char g_sSqlInsert[] = +"INSERT INTO `%s` VALUES (NULL, '%s', '%s', '%s', '%d', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');"; + /* SM1.9 Fix */ -static const char g_sSqlSave[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE steam = '%s';"; +static const char g_sSqlSave[] = +"UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i', suicides='%i', tk='%i', shots='%i', hits='%i', headshots='%i', rounds_tr = '%i', rounds_ct = '%i', lastip='%s', name='%s'%s, head='%i', chest='%i', stomach='%i', left_arm='%i', right_arm='%i', left_leg='%i', right_leg='%i' WHERE steam = '%s';"; + static const char g_sSqlSaveName[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE name = '%s';"; static const char g_sSqlSaveIp[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE lastip = '%s';"; static const char g_sSqlSave2[] = "UPDATE `%s` SET c4_planted='%i',c4_exploded='%i',c4_defused='%i',ct_win='%i',tr_win='%i', hostages_rescued='%i',vip_killed = '%d',vip_escaped = '%d',vip_played = '%d', mvp='%i', damage='%i', match_win='%i', match_draw='%i', match_lose='%i', first_blood='%i', no_scope='%i', no_scope_dis='%i', thru_smoke='%i', blind='%i', assist_flash='%i', assist_team_flash='%i', assist_team_kill='%i', wallbang='%i', lastconnect='%i', connected='%i' WHERE steam = '%s';"; @@ -75,9 +79,9 @@ bool hidechat[MAXPLAYERS+1]; char MSG[64]; -#include -#include -#include +#include +#include +#include public Plugin myinfo = { name = "RankMe", @@ -154,10 +158,10 @@ public void OnPluginStart() { RegConsoleCmd("sm_rankmechat", CMD_HideChat, "Disable rankme chat messages"); // LOAD RANKME.CFG - AutoExecConfig(true, "kento.rankme"); + AutoExecConfig(true, "advanced.rankme"); // LOAD TRANSLATIONS - LoadTranslations("kento.rankme.phrases"); + LoadTranslations("advanced.rankme.phrases"); // Hook the say and say_team for chat triggers AddCommandListener(OnSayText, "say"); @@ -197,9 +201,9 @@ public void DB_Connect(bool firstload) { g_cvarSQLTable.GetString(g_sSQLTable, sizeof(g_sSQLTable)); char sError[256]; if (g_bMysql) { - g_hStatsDb = SQL_Connect("kento_rankme", false, sError, sizeof(sError)); + g_hStatsDb = SQL_Connect("rankme_advanced", false, sError, sizeof(sError)); } else { - g_hStatsDb = SQLite_UseDatabase("kento_rankme", sError, sizeof(sError)); + g_hStatsDb = SQLite_UseDatabase("rankme_advanced", sError, sizeof(sError)); } if (g_hStatsDb == INVALID_HANDLE) @@ -461,9 +465,9 @@ public void OnPluginEnd() { //ReplaceString(name, sizeof(name), "'", ""); char weapons_query[2000] = ""; - int weapon_array[42]; + int weapon_array[48]; g_aWeapons[client].GetData(weapon_array); - for (int i = 0; i < 42; i++) { + for (int i = 0; i < 48; i++) { Format(weapons_query, sizeof(weapons_query), "%s,%s='%d'", weapons_query, g_sWeaponsNamesGame[i], weapon_array[i]); } @@ -537,7 +541,7 @@ public void OnPluginEnd() { public int GetWeaponNum(char[] weaponname) { - for (int i = 0; i < 42; i++) { + for (int i = 0; i < 48; i++) { if (StrEqual(weaponname, g_sWeaponsNamesGame[i])) return i; } @@ -1105,7 +1109,7 @@ public Action EventPlayerDeath(Handle event, const char [] name, bool dontBroadc g_aStats[attacker].SCORE += score_dif; g_aSession[attacker].SCORE += score_dif; int num = GetWeaponNum(weapon); - if (num < 42) g_aWeapons[attacker].AddKill(num); + if (num < 48) g_aWeapons[attacker].AddKill(num); } if (g_MinimalKills == 0 || (g_aStats[victim].KILLS >= g_MinimalKills && g_aStats[attacker].KILLS >= g_MinimalKills)) { @@ -1390,9 +1394,9 @@ public void SalvarPlayer(int client) { //ReplaceString(name, sizeof(name), "'", ""); char weapons_query[2000] = ""; - int weapon_array[42]; + int weapon_array[48]; g_aWeapons[client].GetData(weapon_array); - for (int i = 0; i < 42; i++) { + for (int i = 0; i < 48; i++) { Format(weapons_query, sizeof(weapons_query), "%s,%s='%d'", weapons_query, g_sWeaponsNamesGame[i], weapon_array[i]); } From c3c44a317ccc7d725ca9c7c92c0b6bccd45e9920 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 10:30:47 +0545 Subject: [PATCH 07/11] Update kento_rankme.sp --- scripting/kento_rankme.sp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripting/kento_rankme.sp b/scripting/kento_rankme.sp index 2b436e9..9297d2b 100644 --- a/scripting/kento_rankme.sp +++ b/scripting/kento_rankme.sp @@ -79,9 +79,9 @@ bool hidechat[MAXPLAYERS+1]; char MSG[64]; -#include -#include -#include +#include +#include +#include public Plugin myinfo = { name = "RankMe", @@ -158,10 +158,10 @@ public void OnPluginStart() { RegConsoleCmd("sm_rankmechat", CMD_HideChat, "Disable rankme chat messages"); // LOAD RANKME.CFG - AutoExecConfig(true, "advanced.rankme"); + AutoExecConfig(true, "kento.rankme"); // LOAD TRANSLATIONS - LoadTranslations("advanced.rankme.phrases"); + LoadTranslations("kento.rankme.phrases"); // Hook the say and say_team for chat triggers AddCommandListener(OnSayText, "say"); @@ -201,9 +201,9 @@ public void DB_Connect(bool firstload) { g_cvarSQLTable.GetString(g_sSQLTable, sizeof(g_sSQLTable)); char sError[256]; if (g_bMysql) { - g_hStatsDb = SQL_Connect("rankme_advanced", false, sError, sizeof(sError)); + g_hStatsDb = SQL_Connect("rankme", false, sError, sizeof(sError)); } else { - g_hStatsDb = SQLite_UseDatabase("rankme_advanced", sError, sizeof(sError)); + g_hStatsDb = SQLite_UseDatabase("rankme", sError, sizeof(sError)); } if (g_hStatsDb == INVALID_HANDLE) From 7a5d58040fafaf675e5a1e0dcb38372af441fe4b Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:38:05 +0545 Subject: [PATCH 08/11] Update kento_rankme.sp --- scripting/kento_rankme.sp | 197 +++++++++++++++++++------------------- 1 file changed, 98 insertions(+), 99 deletions(-) diff --git a/scripting/kento_rankme.sp b/scripting/kento_rankme.sp index 9297d2b..8f150ef 100644 --- a/scripting/kento_rankme.sp +++ b/scripting/kento_rankme.sp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include @@ -21,16 +21,12 @@ #define SENDER_WORLD 0 #define MAX_LENGTH_MENU 512 -static const char g_sSqliteCreate[] = "CREATE TABLE IF NOT EXISTS` % s`(id INTEGER PRIMARY KEY, steam VARCHAR(40)NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC, knife NUMERIC, glock NUMERIC, hkp2000 NUMERIC, usp NUMERIC, p250 NUMERIC, p228 NUMERIC, deagle NUMERIC, elite NUMERIC, fiveseven NUMERIC, tec9 NUMERIC, cz75a NUMERIC, revolver NUMERIC, m3 NUMERIC, xm1014 NUMERIC, mag7 NUMERIC, sawedoff NUMERIC, bizon NUMERIC, tmp NUMERIC, mac10 NUMERIC, mp9 NUMERIC, mp5navy NUMERIC, mp7 NUMERIC, ump45 NUMERIC, p90 NUMERIC, galil NUMERIC, ak47 NUMERIC, scar20 NUMERIC, scout NUMERIC, sg552 NUMERIC, famas NUMERIC, m4a1 NUMERIC, m4a1_silencer NUMERIC, aug NUMERIC, ssg08 NUMERIC, sg556 NUMERIC, awp NUMERIC, sg550 NUMERIC, g3sg1 NUMERIC, m249 NUMERIC, negev NUMERIC, hegrenade NUMERIC, flashbang NUMERIC, smokegrenade NUMERIC, inferno NUMERIC, decoy NUMERIC, taser NUMERIC, mp5sd NUMERIC, breachcharge NUMERIC, head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC, c4_planted NUMERIC, c4_exploded NUMERIC, c4_defused NUMERIC, ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC)"; -static const char g_sMysqlCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam VARCHAR(40) NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp NUMERIC,p250 NUMERIC,p228 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,m3 NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,tmp NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp5navy NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galil NUMERIC,ak47 NUMERIC,scar20 NUMERIC,scout NUMERIC,sg552 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,sg550 NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; -static const char g_sSqlInsert[] = -"INSERT INTO `%s` VALUES (NULL, '%s', '%s', '%s', '%d', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');"; - +static const char g_sSqliteCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam VARCHAR(40) NOT NULL, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp_silencer NUMERIC,p250 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,nova NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galilar NUMERIC,ak47 NUMERIC,scar20 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,m3 NUMERIC,usp NUMERIC,p228 NUMERIC,galil NUMERIC,scout NUMERIC,sg552 NUMERIC,sg550 NUMERIC,mp5navy NUMERIC,tmp NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC)"; +static const char g_sMysqlCreate[] = "CREATE TABLE IF NOT EXISTS `%s` (id INTEGER PRIMARY KEY, steam TEXT, name TEXT, lastip TEXT, score NUMERIC, kills NUMERIC, deaths NUMERIC, assists NUMERIC, suicides NUMERIC, tk NUMERIC, shots NUMERIC, hits NUMERIC, headshots NUMERIC, connected NUMERIC, rounds_tr NUMERIC, rounds_ct NUMERIC, lastconnect NUMERIC,knife NUMERIC,glock NUMERIC,hkp2000 NUMERIC,usp_silencer NUMERIC,p250 NUMERIC,deagle NUMERIC,elite NUMERIC,fiveseven NUMERIC,tec9 NUMERIC,cz75a NUMERIC,revolver NUMERIC,nova NUMERIC,xm1014 NUMERIC,mag7 NUMERIC,sawedoff NUMERIC,bizon NUMERIC,mac10 NUMERIC,mp9 NUMERIC,mp7 NUMERIC,ump45 NUMERIC,p90 NUMERIC,galilar NUMERIC,ak47 NUMERIC,scar20 NUMERIC,famas NUMERIC,m4a1 NUMERIC,m4a1_silencer NUMERIC,aug NUMERIC,ssg08 NUMERIC,sg556 NUMERIC,awp NUMERIC,g3sg1 NUMERIC,m249 NUMERIC,negev NUMERIC,hegrenade NUMERIC,flashbang NUMERIC,smokegrenade NUMERIC,inferno NUMERIC,decoy NUMERIC,taser NUMERIC,mp5sd NUMERIC,breachcharge NUMERIC,m3 NUMERIC,usp NUMERIC,p228 NUMERIC,galil NUMERIC,scout NUMERIC,sg552 NUMERIC,sg550 NUMERIC,mp5navy NUMERIC,tmp NUMERIC,head NUMERIC, chest NUMERIC, stomach NUMERIC, left_arm NUMERIC, right_arm NUMERIC, left_leg NUMERIC, right_leg NUMERIC,c4_planted NUMERIC,c4_exploded NUMERIC,c4_defused NUMERIC,ct_win NUMERIC, tr_win NUMERIC, hostages_rescued NUMERIC, vip_killed NUMERIC, vip_escaped NUMERIC, vip_played NUMERIC, mvp NUMERIC, damage NUMERIC, match_win NUMERIC, match_draw NUMERIC, match_lose NUMERIC, first_blood NUMERIC, no_scope NUMERIC, no_scope_dis NUMERIC, thru_smoke NUMERIC, blind NUMERIC, assist_flash NUMERIC, assist_team_flash NUMERIC, assist_team_kill NUMERIC, wallbang NUMERIC) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; +static const char g_sSqlInsert[] = "INSERT INTO `%s` VALUES (NULL,'%s','%s','%s','%d','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');"; /* SM1.9 Fix */ -static const char g_sSqlSave[] = -"UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i', suicides='%i', tk='%i', shots='%i', hits='%i', headshots='%i', rounds_tr = '%i', rounds_ct = '%i', lastip='%s', name='%s'%s, head='%i', chest='%i', stomach='%i', left_arm='%i', right_arm='%i', left_leg='%i', right_leg='%i' WHERE steam = '%s';"; - +static const char g_sSqlSave[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE steam = '%s';"; static const char g_sSqlSaveName[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE name = '%s';"; static const char g_sSqlSaveIp[] = "UPDATE `%s` SET score = '%i', kills = '%i', deaths='%i', assists='%i',suicides='%i',tk='%i',shots='%i',hits='%i',headshots='%i', rounds_tr = '%i', rounds_ct = '%i',lastip='%s',name='%s'%s,head='%i',chest='%i', stomach='%i',left_arm='%i',right_arm='%i',left_leg='%i',right_leg='%i' WHERE lastip = '%s';"; static const char g_sSqlSave2[] = "UPDATE `%s` SET c4_planted='%i',c4_exploded='%i',c4_defused='%i',ct_win='%i',tr_win='%i', hostages_rescued='%i',vip_killed = '%d',vip_escaped = '%d',vip_played = '%d', mvp='%i', damage='%i', match_win='%i', match_draw='%i', match_lose='%i', first_blood='%i', no_scope='%i', no_scope_dis='%i', thru_smoke='%i', blind='%i', assist_flash='%i', assist_team_flash='%i', assist_team_kill='%i', wallbang='%i', lastconnect='%i', connected='%i' WHERE steam = '%s';"; @@ -46,8 +42,8 @@ static const char g_sSqlRemoveDuplicateIpSQLite[] = "delete from `%s` where `%s` static const char g_sSqlRemoveDuplicateMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.steam=vtable.steam);"; static const char g_sSqlRemoveDuplicateNameMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.name=vtable.name);"; static const char g_sSqlRemoveDuplicateIpMySQL[] = "delete from `%s` USING `%s`, `%s` as vtable WHERE (`%s`.id>vtable.id) AND (`%s`.ip=vtable.ip);"; -stock const char g_sWeaponsNamesGame[48][] = { "knife", "glock", "hkp2000", "usp", "p250", "p228", "deagle", "elite", "fiveseven", "tec9", "cz75a", "revolver", "m3", "xm1014", "mag7", "sawedoff", "bizon", "tmp", "mac10", "mp9", "mp5navy", "mp7", "ump45", "p90", "galil", "ak47", "scar20", "scout", "sg552", "famas", "m4a1", "m4a1_silencer", "aug", "ssg08", "sg556", "sg550", "awp", "g3sg1", "m249", "negev", "hegrenade", "flashbang", "smokegrenade", "inferno", "decoy", "taser", "mp5sd", "breachcharge"}; -stock const char g_sWeaponsNamesFull[48][] = { "Knife", "Glock 19", "P2000", "Heckler & Koch USP45 Tactical", "P250", "SIG-Sauer P228", "Desert Eagle", "Dual Elites", "Five-Seven", "Tec 9", "CZ75-Auto", "R8 Revolver", "Benelli M3 Super 90", "Benelli M4 Super 90", "Mag 7", "Sawed-off", "PP-Bizon", "Steyr TMP", "Ingram MAC-10", "MP9", "Heckler & Koch MP5N", "MP7", "Heckler & Koch UMP45", "Fabrique Nationale P90", "IMI Galil ARM", "AK-47", "SCAR-20", "Steyr Scout", "SIG SG 552", "FAMAS F1", "M4A4", "M4A1-S", "Steyr AUG A1", "SSG 08", "SG 553", "SIG SG 550 SR", "Accuracy International Arctic Warfare Super Magnum", "Heckler & Koch G3SG/1", "FN M249-E2 SAW", "Negev", "HE Grenade", "Flashbang", "Smoke Grenade", "Inferno", "Decoy", "Zeus x27", "MP5-SD", "Breach Charges"}; +stock const char g_sWeaponsNamesGame[51][] = { "knife", "glock", "hkp2000", "usp_silencer", "p250", "deagle", "elite", "fiveseven", "tec9", "cz75a", "revolver", "nova", "xm1014", "mag7", "sawedoff", "bizon", "mac10", "mp9", "mp7", "ump45", "p90", "galilar", "ak47", "scar20", "famas", "m4a1", "m4a1_silencer", "aug", "ssg08", "sg556", "awp", "g3sg1", "m249", "negev", "hegrenade", "flashbang", "smokegrenade", "inferno", "decoy", "taser", "mp5sd", "breachcharge", "m3", "usp", "p228", "galil", "scout", "sg552", "sg550", "mp5navy", "tmp"}; +stock const char g_sWeaponsNamesFull[51][] = { "Knife", "Glock", "P2000", "USP-S", "P250", "Desert Eagle", "Dual Berettas", "Five-Seven", "Tec 9", "CZ75-Auto", "R8 Revolver", "Nova", "XM1014", "Mag 7", "Sawed-off", "PP-Bizon", "MAC-10", "MP9", "MP7", "UMP45", "P90", "Galil AR", "AK-47", "SCAR-20", "Famas", "M4A4", "M4A1-S", "AUG", "SSG 08", "SG 553", "AWP", "G3SG1", "M249", "Negev", "HE Grenade", "Flashbang", "Smoke Grenade", "Inferno", "Decoy", "Zeus x27", "MP5-SD", "Breach Charges", "Benelli M3 Super 90", "Heckler & Koch USP45 Tactical", "SIG-Sauer P228", "IMI Galil ARM", "Steyr Scout", "SIG SG 552", "SIG SG 550 SR", "Heckler & Koch MP5N", "Steyr TMP"}; char g_sSQLTable[200]; Handle g_hStatsDb; @@ -85,10 +81,10 @@ char MSG[64]; public Plugin myinfo = { name = "RankMe", - author = "lok1, Scooby, Kento, pracc, Kxnrl, CrazyHackGUT, +SyntX34", - description = "Improved RankMe for CSS/CSGO/CS2", + author = "lok1, Scooby, Kento, pracc, Kxnrl, CrazyHackGUT, +SyntX (Added support for CS:Source)", + description = "Improved RankMe for CSS/CSGO", version = PLUGIN_VERSION, - url = "" + url = "https://github.com/id/SyntX34" //https://github.com/rogeraabbccdd/Kento-Rankme }; public void OnPluginStart() { @@ -121,10 +117,7 @@ public void OnPluginStart() { RegAdminCmd("sm_resetrank", CMD_ResetRank, ADMFLAG_ROOT, "RankMe: Resets the rank of a player"); RegAdminCmd("sm_rankme_remove_duplicate", CMD_Duplicate, ADMFLAG_ROOT, "RankMe: Removes the duplicated rows on the database"); RegAdminCmd("sm_rankpurge", CMD_Purge, ADMFLAG_ROOT, "RankMe: Purges from the rank players that didn't connected for X days"); - RegAdminCmd("sm_resetallrank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); - RegAdminCmd("sm_restartrank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); - RegAdminCmd("sm_eraserank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); - RegAdminCmd("sm_wiperank", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); + RegAdminCmd("sm_resetrank_all", CMD_ResetRankAll, ADMFLAG_ROOT, "RankMe: Resets the rank of all players"); // PLAYER COMMANDS RegConsoleCmd("sm_session", CMD_Session, "RankMe: Shows the stats of your current session"); @@ -465,9 +458,9 @@ public void OnPluginEnd() { //ReplaceString(name, sizeof(name), "'", ""); char weapons_query[2000] = ""; - int weapon_array[48]; + int weapon_array[51]; g_aWeapons[client].GetData(weapon_array); - for (int i = 0; i < 48; i++) { + for (int i = 0; i < 51; i++) { Format(weapons_query, sizeof(weapons_query), "%s,%s='%d'", weapons_query, g_sWeaponsNamesGame[i], weapon_array[i]); } @@ -541,7 +534,7 @@ public void OnPluginEnd() { public int GetWeaponNum(char[] weaponname) { - for (int i = 0; i < 48; i++) { + for (int i = 0; i < 51; i++) { if (StrEqual(weaponname, g_sWeaponsNamesGame[i])) return i; } @@ -1109,7 +1102,7 @@ public Action EventPlayerDeath(Handle event, const char [] name, bool dontBroadc g_aStats[attacker].SCORE += score_dif; g_aSession[attacker].SCORE += score_dif; int num = GetWeaponNum(weapon); - if (num < 48) g_aWeapons[attacker].AddKill(num); + if (num < 51) g_aWeapons[attacker].AddKill(num); } if (g_MinimalKills == 0 || (g_aStats[victim].KILLS >= g_MinimalKills && g_aStats[attacker].KILLS >= g_MinimalKills)) { @@ -1199,7 +1192,7 @@ public Action EventPlayerDeath(Handle event, const char [] name, bool dontBroadc } /* No scope */ - if( attacker < MAXPLAYERS && ((StrContains(weapon, "awp") != -1 || StrContains(weapon, "ssg08") != -1) || (g_bNSAllSnipers && (StrContains(weapon, "g3sg1") != -1 || StrContains(weapon, "scar20") != -1))) && (GetEntProp(attacker, Prop_Data, "m_iFOV") <= 0 || GetEntProp(attacker, Prop_Data, "m_iFOV") == GetEntProp(attacker, Prop_Data, "m_iDefaultFOV"))) + if( attacker < MAXPLAYERS && ((StrContains(weapon, "awp") != -1 || StrContains(weapon, "ssg08") != -1) || StrContains(weapon, "scout") != -1 || (g_bNSAllSnipers && (StrContains(weapon, "g3sg1") != -1 || StrContains(weapon, "scar20") != -1) || StrContains(weapon, "sg550"))) && (GetEntProp(attacker, Prop_Data, "m_iFOV") <= 0 || GetEntProp(attacker, Prop_Data, "m_iFOV") == GetEntProp(attacker, Prop_Data, "m_iDefaultFOV"))) { g_aStats[attacker].SCORE+= g_PointsNS; g_aSession[attacker].SCORE+= g_PointsNS; @@ -1394,9 +1387,9 @@ public void SalvarPlayer(int client) { //ReplaceString(name, sizeof(name), "'", ""); char weapons_query[2000] = ""; - int weapon_array[48]; + int weapon_array[51]; g_aWeapons[client].GetData(weapon_array); - for (int i = 0; i < 48; i++) { + for (int i = 0; i < 51; i++) { Format(weapons_query, sizeof(weapons_query), "%s,%s='%d'", weapons_query, g_sWeaponsNamesGame[i], weapon_array[i]); } @@ -1587,85 +1580,91 @@ public void SQL_LoadPlayerCallback(Handle owner, Handle hndl, const char[] error g_aWeapons[client].KNIFE = SQL_FetchInt(hndl, 17); g_aWeapons[client].GLOCK = SQL_FetchInt(hndl, 18); g_aWeapons[client].HKP2000 = SQL_FetchInt(hndl, 19); - g_aWeapons[client].USP = SQL_FetchInt(hndl, 20); + g_aWeapons[client].USP_SILENCER = SQL_FetchInt(hndl, 20); g_aWeapons[client].P250 = SQL_FetchInt(hndl, 21); - g_aWeapons[client].P228 = SQL_FetchInt(hndl, 22); - g_aWeapons[client].DEAGLE = SQL_FetchInt(hndl, 23); - g_aWeapons[client].ELITE = SQL_FetchInt(hndl, 24); - g_aWeapons[client].FIVESEVEN = SQL_FetchInt(hndl, 25); - g_aWeapons[client].TEC9 = SQL_FetchInt(hndl, 26); - g_aWeapons[client].CZ75A = SQL_FetchInt(hndl, 27); - g_aWeapons[client].REVOLVER = SQL_FetchInt(hndl, 28); - g_aWeapons[client].M3 = SQL_FetchInt(hndl, 29); - g_aWeapons[client].XM1014 = SQL_FetchInt(hndl, 30); - g_aWeapons[client].MAG7 = SQL_FetchInt(hndl, 31); - g_aWeapons[client].SAWEDOFF = SQL_FetchInt(hndl, 32); - g_aWeapons[client].BIZON = SQL_FetchInt(hndl, 33); - g_aWeapons[client].TMP = SQL_FetchInt(hndl, 34); - g_aWeapons[client].MAC10 = SQL_FetchInt(hndl, 35); - g_aWeapons[client].MP9 = SQL_FetchInt(hndl, 36); - g_aWeapons[client].MP5NAVY = SQL_FetchInt(hndl, 37); - g_aWeapons[client].MP7 = SQL_FetchInt(hndl, 38); - g_aWeapons[client].UMP45 = SQL_FetchInt(hndl, 39); - g_aWeapons[client].P90 = SQL_FetchInt(hndl, 40); - g_aWeapons[client].GALIL = SQL_FetchInt(hndl, 41); - g_aWeapons[client].AK47 = SQL_FetchInt(hndl, 42); - g_aWeapons[client].SCAR20 = SQL_FetchInt(hndl, 43); - g_aWeapons[client].SCOUT = SQL_FetchInt(hndl, 44); - g_aWeapons[client].SG552 = SQL_FetchInt(hndl, 45); - g_aWeapons[client].FAMAS = SQL_FetchInt(hndl, 46); - g_aWeapons[client].M4A1 = SQL_FetchInt(hndl, 47); - g_aWeapons[client].M4A1_SILENCER = SQL_FetchInt(hndl, 48); - g_aWeapons[client].AUG = SQL_FetchInt(hndl, 49); - g_aWeapons[client].SSG08 = SQL_FetchInt(hndl, 50); - g_aWeapons[client].SG556 = SQL_FetchInt(hndl, 51); - g_aWeapons[client].SG550 = SQL_FetchInt(hndl, 52); - g_aWeapons[client].AWP = SQL_FetchInt(hndl, 53); - g_aWeapons[client].G3SG1 = SQL_FetchInt(hndl, 54); - g_aWeapons[client].M249 = SQL_FetchInt(hndl, 55); - g_aWeapons[client].NEGEV = SQL_FetchInt(hndl, 56); - g_aWeapons[client].HEGRENADE = SQL_FetchInt(hndl, 57); - g_aWeapons[client].FLASHBANG = SQL_FetchInt(hndl, 58); - g_aWeapons[client].SMOKEGRENADE = SQL_FetchInt(hndl, 59); - g_aWeapons[client].INFERNO = SQL_FetchInt(hndl, 60); - g_aWeapons[client].DECOY = SQL_FetchInt(hndl, 61); - g_aWeapons[client].TASER = SQL_FetchInt(hndl, 62); - g_aWeapons[client].MP5SD = SQL_FetchInt(hndl, 63); - g_aWeapons[client].BREACHCHARGE = SQL_FetchInt(hndl, 64); + g_aWeapons[client].DEAGLE = SQL_FetchInt(hndl, 22); + g_aWeapons[client].ELITE = SQL_FetchInt(hndl, 23); + g_aWeapons[client].FIVESEVEN = SQL_FetchInt(hndl, 24); + g_aWeapons[client].TEC9 = SQL_FetchInt(hndl, 25); + g_aWeapons[client].CZ75A = SQL_FetchInt(hndl, 26); + g_aWeapons[client].REVOLVER = SQL_FetchInt(hndl, 27); + g_aWeapons[client].NOVA = SQL_FetchInt(hndl, 28); + g_aWeapons[client].XM1014 = SQL_FetchInt(hndl, 29); + g_aWeapons[client].MAG7 = SQL_FetchInt(hndl, 30); + g_aWeapons[client].SAWEDOFF = SQL_FetchInt(hndl, 31); + g_aWeapons[client].BIZON = SQL_FetchInt(hndl, 32); + g_aWeapons[client].MAC10 = SQL_FetchInt(hndl, 33); + g_aWeapons[client].MP9 = SQL_FetchInt(hndl, 34); + g_aWeapons[client].MP7 = SQL_FetchInt(hndl, 35); + g_aWeapons[client].UMP45 = SQL_FetchInt(hndl, 36); + g_aWeapons[client].P90 = SQL_FetchInt(hndl, 37); + g_aWeapons[client].GALILAR = SQL_FetchInt(hndl, 38); + g_aWeapons[client].AK47 = SQL_FetchInt(hndl, 39); + g_aWeapons[client].SCAR20 = SQL_FetchInt(hndl, 40); + g_aWeapons[client].FAMAS = SQL_FetchInt(hndl, 41); + g_aWeapons[client].M4A1 = SQL_FetchInt(hndl, 42); + g_aWeapons[client].M4A1_SILENCER = SQL_FetchInt(hndl, 43); + g_aWeapons[client].AUG = SQL_FetchInt(hndl, 44); + g_aWeapons[client].SSG08 = SQL_FetchInt(hndl, 45); + g_aWeapons[client].SG556 = SQL_FetchInt(hndl, 46); + g_aWeapons[client].AWP = SQL_FetchInt(hndl, 47); + g_aWeapons[client].G3SG1 = SQL_FetchInt(hndl, 48); + g_aWeapons[client].M249 = SQL_FetchInt(hndl, 49); + g_aWeapons[client].NEGEV = SQL_FetchInt(hndl, 50); + g_aWeapons[client].HEGRENADE = SQL_FetchInt(hndl, 51); + g_aWeapons[client].FLASHBANG = SQL_FetchInt(hndl, 52); + g_aWeapons[client].SMOKEGRENADE = SQL_FetchInt(hndl, 53); + g_aWeapons[client].INFERNO = SQL_FetchInt(hndl, 54); + g_aWeapons[client].DECOY = SQL_FetchInt(hndl, 55); + g_aWeapons[client].TASER = SQL_FetchInt(hndl, 56); + g_aWeapons[client].MP5SD = SQL_FetchInt(hndl, 57); + g_aWeapons[client].BREACHCHARGE = SQL_FetchInt(hndl, 58); + + // CS:S + g_aWeapons[client].M3 = SQL_FetchInt(hndl, 59); + g_aWeapons[client].USP = SQL_FetchInt(hndl, 60); + g_aWeapons[client].P228 = SQL_FetchInt(hndl, 61); + g_aWeapons[client].GALIL = SQL_FetchInt(hndl, 62); + g_aWeapons[client].SCOUT = SQL_FetchInt(hndl, 63); + g_aWeapons[client].SG552 = SQL_FetchInt(hndl, 64); + g_aWeapons[client].SG550 = SQL_FetchInt(hndl, 65); + g_aWeapons[client].MP5NAVY = SQL_FetchInt(hndl, 66); + g_aWeapons[client].TMP = SQL_FetchInt(hndl, 67); //ALL 8 Hitboxes - g_aHitBox[client].HEAD = SQL_FetchInt(hndl, 65); - g_aHitBox[client].CHEST = SQL_FetchInt(hndl, 66); - g_aHitBox[client].STOMACH = SQL_FetchInt(hndl, 67); - g_aHitBox[client].LEFT_ARM = SQL_FetchInt(hndl, 68); - g_aHitBox[client].RIGHT_ARM = SQL_FetchInt(hndl, 69); - g_aHitBox[client].LEFT_LEG = SQL_FetchInt(hndl, 70); - g_aHitBox[client].RIGHT_LEG = SQL_FetchInt(hndl, 71); + g_aHitBox[client].HEAD = SQL_FetchInt(hndl, 68); + g_aHitBox[client].CHEST = SQL_FetchInt(hndl, 69); + g_aHitBox[client].STOMACH = SQL_FetchInt(hndl, 70); + g_aHitBox[client].LEFT_ARM = SQL_FetchInt(hndl, 71); + g_aHitBox[client].RIGHT_ARM = SQL_FetchInt(hndl, 72); + g_aHitBox[client].LEFT_LEG = SQL_FetchInt(hndl, 73); + g_aHitBox[client].RIGHT_LEG = SQL_FetchInt(hndl, 74); // other stats - g_aStats[client].C4_PLANTED = SQL_FetchInt(hndl, 72); - g_aStats[client].C4_EXPLODED = SQL_FetchInt(hndl, 73); - g_aStats[client].C4_DEFUSED = SQL_FetchInt(hndl, 74); - g_aStats[client].CT_WIN = SQL_FetchInt(hndl, 75); - g_aStats[client].TR_WIN = SQL_FetchInt(hndl, 76); - g_aStats[client].HOSTAGES_RESCUED = SQL_FetchInt(hndl, 77); - g_aStats[client].VIP_KILLED = SQL_FetchInt(hndl, 78); - g_aStats[client].VIP_ESCAPED = SQL_FetchInt(hndl, 79); - g_aStats[client].VIP_PLAYED = SQL_FetchInt(hndl, 80); - g_aStats[client].MVP = SQL_FetchInt(hndl, 81); - g_aStats[client].DAMAGE = SQL_FetchInt(hndl, 82); - g_aStats[client].MATCH_WIN = SQL_FetchInt(hndl, 83); - g_aStats[client].MATCH_DRAW = SQL_FetchInt(hndl, 84); - g_aStats[client].MATCH_LOSE = SQL_FetchInt(hndl, 85); - g_aStats[client].FB = SQL_FetchInt(hndl, 86); - g_aStats[client].NS = SQL_FetchInt(hndl, 87); - g_aStats[client].NSD = SQL_FetchInt(hndl, 88); - g_aStats[client].SMOKE = SQL_FetchInt(hndl, 89); - g_aStats[client].BLIND = SQL_FetchInt(hndl, 90); - g_aStats[client].AF = SQL_FetchInt(hndl, 91); - g_aStats[client].ATF = SQL_FetchInt(hndl, 92); - g_aStats[client].ATK = SQL_FetchInt(hndl, 93); - g_aStats[client].WALL = SQL_FetchInt(hndl, 94); + g_aStats[client].C4_PLANTED = SQL_FetchInt(hndl, 75); + g_aStats[client].C4_EXPLODED = SQL_FetchInt(hndl, 76); + g_aStats[client].C4_DEFUSED = SQL_FetchInt(hndl, 77); + g_aStats[client].CT_WIN = SQL_FetchInt(hndl, 78); + g_aStats[client].TR_WIN = SQL_FetchInt(hndl, 79); + g_aStats[client].HOSTAGES_RESCUED = SQL_FetchInt(hndl, 80); + g_aStats[client].VIP_KILLED = SQL_FetchInt(hndl, 81); + g_aStats[client].VIP_ESCAPED = SQL_FetchInt(hndl, 82); + g_aStats[client].VIP_PLAYED = SQL_FetchInt(hndl, 83); + g_aStats[client].MVP = SQL_FetchInt(hndl, 84); + g_aStats[client].DAMAGE = SQL_FetchInt(hndl, 85); + g_aStats[client].MATCH_WIN = SQL_FetchInt(hndl, 86); + g_aStats[client].MATCH_DRAW = SQL_FetchInt(hndl, 87); + g_aStats[client].MATCH_LOSE = SQL_FetchInt(hndl, 88); + g_aStats[client].FB = SQL_FetchInt(hndl, 89); + g_aStats[client].NS = SQL_FetchInt(hndl, 90); + g_aStats[client].NSD = SQL_FetchInt(hndl, 91); + g_aStats[client].SMOKE = SQL_FetchInt(hndl, 92); + g_aStats[client].BLIND = SQL_FetchInt(hndl, 93); + g_aStats[client].AF = SQL_FetchInt(hndl, 94); + g_aStats[client].ATF = SQL_FetchInt(hndl, 95); + g_aStats[client].ATK = SQL_FetchInt(hndl, 96); + g_aStats[client].WALL = SQL_FetchInt(hndl, 97); + //LogMessage("Number of fields in result: %d", SQL_HasResultSet(hndl)); } else { char query[10000]; char sEscapeName[MAX_NAME_LENGTH * 2 + 1]; From 16c07aab8a12a3cbcbb5402e84c054e41a46b491 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:38:56 +0545 Subject: [PATCH 09/11] Update rankme.inc --- scripting/include/kento_rankme/rankme.inc | 313 ++++++++++++---------- 1 file changed, 168 insertions(+), 145 deletions(-) diff --git a/scripting/include/kento_rankme/rankme.inc b/scripting/include/kento_rankme/rankme.inc index 5584b76..2dcfc4d 100644 --- a/scripting/include/kento_rankme/rankme.inc +++ b/scripting/include/kento_rankme/rankme.inc @@ -4,134 +4,138 @@ #define _rankme_included enum struct WEAPONS_ENUM{ - int KNIFE; - int GLOCK; - int HKP2000; - int USP; - int P250; - int P228; - int DEAGLE; - int ELITE; - int FIVESEVEN; - int TEC9; - int CZ75A; - int REVOLVER; - int M3; - int XM1014; - int MAG7; - int SAWEDOFF; - int BIZON; - int TMP; - int MAC10; - int MP9; - int MP5NAVY; - int MP7; - int UMP45; - int P90; - int GALIL; - int AK47; - int SCAR20; - int SCOUT; - int SG552; - int FAMAS; - int M4A1; - int M4A1_SILENCER; - int AUG; - int SSG08; - int SG556; - int AWP; - int SG550; - int G3SG1; - int M249; - int NEGEV; - int HEGRENADE; - int FLASHBANG; - int SMOKEGRENADE; - int INFERNO; - int DECOY; - int TASER; - int MP5SD; - int BREACHCHARGE; + int KNIFE; //done + int GLOCK; //done + int HKP2000; //done + int USP_SILENCER; //done + int P250; //done + int DEAGLE; //done + int ELITE; //done + int FIVESEVEN; //done + int TEC9; //done + int CZ75A; //done + int REVOLVER; //done + int NOVA; //done + int XM1014; //done + int MAG7; //done + int SAWEDOFF; //done + int BIZON; //done + int MAC10; //done + int MP9; //done + int MP7; //done + int UMP45; //done + int P90; //done + int GALILAR; //done + int AK47; //done + int SCAR20; //done + int FAMAS; //done + int M4A1; //done + int M4A1_SILENCER; //done + int AUG; //done + int SSG08; //done + int SG556; //done + int AWP; //done + int G3SG1; //done + int M249; //done + int NEGEV; //done + int HEGRENADE; //done + int FLASHBANG; //done + int SMOKEGRENADE; //done + int INFERNO; //done + int DECOY; //done + int TASER; //done + int MP5SD; //done + int BREACHCHARGE; //done + // CSS:S + int M3; //done + int USP; //done + int P228; //done + int GALIL; //done + int SCOUT; //done + int SG552; //done + int SG550; //done + int MP5NAVY; //done + int TMP; //done int GetData(int[] data) { data[0] = this.KNIFE; data[1] = this.GLOCK; data[2] = this.HKP2000; - data[3] = this.USP; + data[3] = this.USP_SILENCER; data[4] = this.P250; - data[5] = this.P228; - data[6] = this.DEAGLE; - data[7] = this.ELITE; - data[8] = this.FIVESEVEN; - data[9] = this.TEC9; - data[10] = this.CZ75A; - data[11] = this.REVOLVER; - data[12] = this.M3; - data[13] = this.XM1014; - data[14] = this.MAG7; - data[15] = this.SAWEDOFF; - data[16] = this.BIZON; - data[17] = this.TMP; - data[18] = this.MAC10; - data[19] = this.MP9; - data[20] = this.MP5NAVY; - data[21] = this.MP7; - data[22] = this.UMP45; - data[23] = this.P90; - data[24] = this.GALIL; - data[25] = this.AK47; - data[26] = this.SCAR20; - data[27] = this.SCOUT; - data[28] = this.SG552; - data[29] = this.FAMAS; - data[30] = this.M4A1; - data[31] = this.M4A1_SILENCER; - data[32] = this.AUG; - data[33] = this.SSG08; - data[34] = this.SG556; - data[35] = this.AWP; - data[36] = this.SG550; - data[37] = this.G3SG1; - data[38] = this.M249; - data[39] = this.NEGEV; - data[40] = this.HEGRENADE; - data[41] = this.FLASHBANG; - data[42] = this.SMOKEGRENADE; - data[43] = this.INFERNO; - data[44] = this.DECOY; - data[45] = this.TASER; - data[46] = this.MP5SD; - data[47] = this.BREACHCHARGE; + data[5] = this.DEAGLE; + data[6] = this.ELITE; + data[7] = this.FIVESEVEN; + data[8] = this.TEC9; + data[9] = this.CZ75A; + data[10] = this.REVOLVER; + data[11] = this.NOVA; + data[12] = this.XM1014; + data[13] = this.MAG7; + data[14] = this.SAWEDOFF; + data[15] = this.BIZON; + data[16] = this.MAC10; + data[17] = this.MP9; + data[18] = this.MP7; + data[19] = this.UMP45; + data[20] = this.P90; + data[21] = this.GALILAR; + data[22] = this.AK47; + data[23] = this.SCAR20; + data[24] = this.FAMAS; + data[25] = this.M4A1; + data[26] = this.M4A1_SILENCER; + data[27] = this.AUG; + data[28] = this.SSG08; + data[29] = this.SG556; + data[30] = this.AWP; + data[31] = this.G3SG1; + data[32] = this.M249; + data[33] = this.NEGEV; + data[34] = this.HEGRENADE; + data[35] = this.FLASHBANG; + data[36] = this.SMOKEGRENADE; + data[37] = this.INFERNO; + data[38] = this.DECOY; + data[39] = this.TASER; + data[40] = this.MP5SD; + data[41] = this.BREACHCHARGE; + // CSS:S + data[42] = this.M3; + data[43] = this.USP; + data[44] = this.P228; + data[45] = this.GALIL; + data[46] = this.SCOUT; + data[47] = this.SG552; + data[48] = this.SG550; + data[49] = this.MP5NAVY; + data[50] = this.TMP; + } void Reset() { this.KNIFE = 0; this.GLOCK = 0; this.HKP2000 = 0; - this.USP = 0; + this.USP_SILENCER = 0; this.P250 = 0; - this.P228 = 0; this.DEAGLE = 0; this.ELITE = 0; this.FIVESEVEN = 0; this.TEC9 = 0; this.CZ75A = 0; this.REVOLVER = 0; - this.M3 = 0; + this.NOVA = 0; this.XM1014 = 0; this.MAG7 = 0; this.SAWEDOFF = 0; this.BIZON = 0; - this.TMP = 0; this.MAC10 = 0; this.MP9 = 0; - this.MP5NAVY = 0; this.MP7 = 0; this.UMP45 = 0; this.P90 = 0; - this.GALIL = 0; + this.GALILAR = 0; this.AK47 = 0; this.SCAR20 = 0; - this.SCOUT = 0; - this.SG552 = 0; this.FAMAS = 0; this.M4A1 = 0; this.M4A1_SILENCER = 0; @@ -139,7 +143,6 @@ enum struct WEAPONS_ENUM{ this.SSG08 = 0; this.SG556 = 0; this.AWP = 0; - this.SG550 = 0; this.G3SG1 = 0; this.M249 = 0; this.NEGEV = 0; @@ -151,6 +154,16 @@ enum struct WEAPONS_ENUM{ this.TASER = 0; this.MP5SD = 0; this.BREACHCHARGE = 0; + // CSS:S + this.M3 = 0; + this.USP = 0; + this.P228 = 0; + this.GALIL = 0; + this.SCOUT = 0; + this.SG552 = 0; + this.SG550 = 0; + this.MP5NAVY = 0; + this.TMP = 0; } void AddKill(int num) { switch(num) { @@ -164,139 +177,149 @@ enum struct WEAPONS_ENUM{ this.HKP2000++; } case 3: { - this.USP++; + this.USP_SILENCER++; } case 4: { this.P250++; } case 5: { - this.P228++; + this.DEAGLE++; } case 6: { - this.DEAGLE++; + this.ELITE++; } case 7: { - this.ELITE++; + this.FIVESEVEN++; } case 8: { - this.FIVESEVEN++; + this.TEC9++; } case 9: { - this.TEC9++; + this.CZ75A++; } case 10: { - this.CZ75A++; + this.REVOLVER++; } case 11: { - this.REVOLVER++; + this.NOVA++; } case 12: { - this.M3++; + this.XM1014++; } case 13: { - this.XM1014++; + this.MAG7++; } case 14: { - this.MAG7++; + this.SAWEDOFF++; } case 15: { - this.SAWEDOFF++; + this.BIZON++; } case 16: { - this.BIZON++; + this.MAC10++; } case 17: { - this.TMP++; + this.MP9++; } case 18: { - this.MAC10++; + this.MP7++; } case 19: { - this.MP9++; + this.UMP45++; } case 20: { - this.MP5NAVY++; + this.P90++; } case 21: { - this.MP7++; + this.GALILAR++; } case 22: { - this.UMP45++; + this.AK47++; } case 23: { - this.P90++; + this.SCAR20++; } case 24: { - this.GALIL++; + this.FAMAS++; } case 25: { - this.AK47++; + this.M4A1++; } case 26: { - this.SCAR20++; + this.M4A1_SILENCER++; } case 27: { - this.SCOUT++; + this.AUG++; } case 28: { - this.SG552++; + this.SSG08++; } case 29: { - this.FAMAS++; + this.SG556++; } case 30: { - this.M4A1++; + this.AWP++; } case 31: { - this.M4A1_SILENCER++; + this.G3SG1++; } case 32: { - this.AUG++; + this.M249++; } case 33: { - this.SSG08++; + this.NEGEV++; } case 34: { - this.SG556++; + this.HEGRENADE++; } case 35: { - this.AWP++; + this.FLASHBANG++; } case 36: { - this.SG550++; + this.SMOKEGRENADE++; } case 37: { - this.G3SG1++; + this.INFERNO++; } case 38: { - this.M249++; + this.DECOY++; } case 39: { - this.NEGEV++; + this.TASER++; } case 40: { - this.HEGRENADE++; + this.MP5SD++; } case 41: { - this.FLASHBANG++; + this.BREACHCHARGE++; } + // CS:S case 42: { - this.SMOKEGRENADE++; + this.M3++; } case 43: { - this.INFERNO++; + this.USP++; } case 44: { - this.DECOY++; + this.P228++; } case 45: { - this.TASER++; + this.GALIL++; } case 46: { - this.MP5SD++; + this.SCOUT++; } case 47: { - this.BREACHCHARGE++; + this.SG552++; + } + case 48: { + this.SG550++; + } + case 49: { + this.MP5NAVY++; + } + case 50: { + this.TMP++; } } } From 1e14e75d6b4ec9310d2001a4f59630c28bee5ffb Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:39:21 +0545 Subject: [PATCH 10/11] Update cmds.inc --- scripting/include/kento_rankme/cmds.inc | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripting/include/kento_rankme/cmds.inc b/scripting/include/kento_rankme/cmds.inc index fc81f1b..380af6e 100644 --- a/scripting/include/kento_rankme/cmds.inc +++ b/scripting/include/kento_rankme/cmds.inc @@ -162,7 +162,7 @@ public Action CMD_TopWeapon(int client, int args){ } else { Menu menu = CreateMenu(MenuHandler_TopWeapon_Choose); menu.SetTitle("Top Weapon:"); - for(int i=0;i<42;i++){ + for(int i=0;i<51;i++){ menu.AddItem(g_sWeaponsNamesGame[i],g_sWeaponsNamesFull[i]); } menu.Display(client,MENU_TIME_FOREVER); @@ -1489,7 +1489,7 @@ public void SQL_StatsMe2Callback(Handle owner, Handle hndl, const char[] error, rounds = 1; } - int idamage = SQL_FetchInt(hndl,76); + int idamage = SQL_FetchInt(hndl,85); float damage = IntToFloat(idamage); int hits = SQL_FetchInt(hndl,11); @@ -1509,22 +1509,22 @@ public void SQL_StatsMe2Callback(Handle owner, Handle hndl, const char[] error, StrCat(text,sizeof(text),temp); Format(temp,sizeof(temp),"%T: %d %T: %.2f %T: %.2f\n","Damage", client, idamage,"KPR", client, kills/rounds, "DPR", client, damage/rounds); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d \n","First Bloods", client, SQL_FetchInt(hndl, 80)); + Format(temp,sizeof(temp),"%T: %d \n","First Bloods", client, SQL_FetchInt(hndl, 89)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d %T: %d\n","Thru Smokes", client, SQL_FetchInt(hndl, 83), "Flashed Kills", client, SQL_FetchInt(hndl, 84)); + Format(temp,sizeof(temp),"%T: %d %T: %d\n","Thru Smokes", client, SQL_FetchInt(hndl, 91), "Flashed Kills", client, SQL_FetchInt(hndl, 92)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d\n","AssistFlashes", client, SQL_FetchInt(hndl, 85)); + Format(temp,sizeof(temp),"%T: %d\n","AssistFlashes", client, SQL_FetchInt(hndl, 94)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d\n","AssistTeamFlashes", client, SQL_FetchInt(hndl, 86)); + Format(temp,sizeof(temp),"%T: %d\n","AssistTeamFlashes", client, SQL_FetchInt(hndl, 95)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d\n","Wallbangs", client, SQL_FetchInt(hndl, 88)); + Format(temp,sizeof(temp),"%T: %d\n","Wallbangs", client, SQL_FetchInt(hndl, 97)); StrCat(text,sizeof(text),temp); panel.AddItem("",text); text=""; Format(temp,sizeof(temp),"- %T\n","RoundStats",client); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d/%d %T: %d/%d %T: %d\n%T: %d %T: %d %T: %d\n","TRWins",client,SQL_FetchInt(hndl,70),SQL_FetchInt(hndl,14),"CTWins",client,SQL_FetchInt(hndl,69),SQL_FetchInt(hndl,15),"MVPs",client,SQL_FetchInt(hndl,75), "MatchWins", client, SQL_FetchInt(hndl, 77), "MatchDraws", client, SQL_FetchInt(hndl, 78), "MatchLosses", client, SQL_FetchInt(hndl, 79)); + Format(temp,sizeof(temp),"%T: %d/%d %T: %d/%d %T: %d\n%T: %d %T: %d %T: %d\n","TRWins",client,SQL_FetchInt(hndl,79),SQL_FetchInt(hndl,14),"CTWins",client,SQL_FetchInt(hndl,78),SQL_FetchInt(hndl,15),"MVPs",client,SQL_FetchInt(hndl,84), "MatchWins", client, SQL_FetchInt(hndl, 86), "MatchDraws", client, SQL_FetchInt(hndl, 87), "MatchLosses", client, SQL_FetchInt(hndl, 88)); StrCat(text,sizeof(text),temp); panel.AddItem("",text); text=""; @@ -1538,16 +1538,16 @@ public void SQL_StatsMe2Callback(Handle owner, Handle hndl, const char[] error, Format(temp,sizeof(temp),"- %T\n","NoScopeStats",client); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d %T: %.2fm \n","NoScopes",client,SQL_FetchInt(hndl,81), "Farthest", client, IntToFloat(SQL_FetchInt(hndl,82))/100 ); + Format(temp,sizeof(temp),"%T: %d %T: %.2fm \n","NoScopes",client,SQL_FetchInt(hndl,90), "Farthest", client, IntToFloat(SQL_FetchInt(hndl,91))/100 ); StrCat(text,sizeof(text),temp); panel.AddItem("",text); text=""; Format(temp,sizeof(temp),"- %T\n","BombHostagesStats",client); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d %T: %d %T: %d\n","PlantedBombs",client,SQL_FetchInt(hndl,66),"ExplodedBombs",client,SQL_FetchInt(hndl,67),"DefusedBombs",client,SQL_FetchInt(hndl,68)); + Format(temp,sizeof(temp),"%T: %d %T: %d %T: %d\n","PlantedBombs",client,SQL_FetchInt(hndl,75),"ExplodedBombs",client,SQL_FetchInt(hndl,76),"DefusedBombs",client,SQL_FetchInt(hndl,77)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d\n","RescuedHostages",client,SQL_FetchInt(hndl,71)); + Format(temp,sizeof(temp),"%T: %d\n","RescuedHostages",client,SQL_FetchInt(hndl,80)); StrCat(text,sizeof(text),temp); panel.AddItem("",text); text=""; @@ -1555,7 +1555,7 @@ public void SQL_StatsMe2Callback(Handle owner, Handle hndl, const char[] error, if(g_bVipEnabled){ Format(temp,sizeof(temp),"- %T\n","VIPStats",client); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d/%d %T: %d\n","VIPEscapes",client,SQL_FetchInt(hndl,73),SQL_FetchInt(hndl,74),"VIPsKilled",client,SQL_FetchInt(hndl,72)); + Format(temp,sizeof(temp),"%T: %d/%d %T: %d\n","VIPEscapes",client,SQL_FetchInt(hndl,82),SQL_FetchInt(hndl,83),"VIPsKilled",client,SQL_FetchInt(hndl,81)); StrCat(text,sizeof(text),temp); panel.AddItem("",text); text=""; @@ -2423,7 +2423,7 @@ public void SQL_TopMVPCallback(Handle owner, Handle hndl, const char[] error, an - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - %t: %d\n",i+at,name,SQL_FetchInt(hndl,4),"MVPs",SQL_FetchInt(hndl,75)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - %t: %d\n",i+at,name,SQL_FetchInt(hndl,4),"MVPs",SQL_FetchInt(hndl,84)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -2537,7 +2537,7 @@ public void SQL_TopDamageCallback(Handle owner, Handle hndl, const char[] error, - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - %t: %d\n",i+at,name,SQL_FetchInt(hndl,4),"Damage",SQL_FetchInt(hndl,74)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) - %t: %d\n",i+at,name,SQL_FetchInt(hndl,4),"Damage",SQL_FetchInt(hndl,85)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -2891,7 +2891,7 @@ public void SQL_TopFBCallback(Handle owner, Handle hndl, const char[] error, any i++; SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,80)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,89)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -3000,7 +3000,7 @@ public void SQL_TopNSCallback(Handle owner, Handle hndl, const char[] error, any i++; SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,81)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,90)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -3110,7 +3110,7 @@ public void SQL_TopNSDCallback(Handle owner, Handle hndl, const char[] error, an SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %.2fm\n",i+at,name,SQL_FetchInt(hndl,4), IntToFloat(SQL_FetchInt(hndl,82))/100); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %.2fm\n",i+at,name,SQL_FetchInt(hndl,4), IntToFloat(SQL_FetchInt(hndl,91))/100); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -3219,7 +3219,7 @@ public void SQL_TopBlindCallback(Handle owner, Handle hndl, const char[] error, i++; SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,84)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,93)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -3328,7 +3328,7 @@ public void SQL_TopSmokeCallback(Handle owner, Handle hndl, const char[] error, i++; SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,83)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,92)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); @@ -3437,7 +3437,7 @@ public void SQL_TopWallCallback(Handle owner, Handle hndl, const char[] error, a i++; SQL_FetchString(hndl,2,name,sizeof(name)); - Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,88)); + Format(sBuffer,sizeof(sBuffer),"%d - %s (%d) : %d\n",i+at,name,SQL_FetchInt(hndl,4),SQL_FetchInt(hndl,97)); if(strlen(temp)+strlen(sBuffer) < MAX_LENGTH_MENU){ Format(temp,sizeof(temp),"%s%s",temp,sBuffer); From f370c4582410c4805b6851def848cede2af662b0 Mon Sep 17 00:00:00 2001 From: Samir Neupane <97087641+SyntX34@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:48:59 +0545 Subject: [PATCH 11/11] Update cmds.inc Fixed damage function --- scripting/include/kento_rankme/cmds.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/include/kento_rankme/cmds.inc b/scripting/include/kento_rankme/cmds.inc index 380af6e..d421cf9 100644 --- a/scripting/include/kento_rankme/cmds.inc +++ b/scripting/include/kento_rankme/cmds.inc @@ -1511,7 +1511,7 @@ public void SQL_StatsMe2Callback(Handle owner, Handle hndl, const char[] error, StrCat(text,sizeof(text),temp); Format(temp,sizeof(temp),"%T: %d \n","First Bloods", client, SQL_FetchInt(hndl, 89)); StrCat(text,sizeof(text),temp); - Format(temp,sizeof(temp),"%T: %d %T: %d\n","Thru Smokes", client, SQL_FetchInt(hndl, 91), "Flashed Kills", client, SQL_FetchInt(hndl, 92)); + Format(temp,sizeof(temp),"%T: %d %T: %d\n","Thru Smokes", client, SQL_FetchInt(hndl, 92), "Flashed Kills", client, SQL_FetchInt(hndl, 93)); StrCat(text,sizeof(text),temp); Format(temp,sizeof(temp),"%T: %d\n","AssistFlashes", client, SQL_FetchInt(hndl, 94)); StrCat(text,sizeof(text),temp);