From 7cf253a076167bd81d035cf3b3237f1d948f0dfc Mon Sep 17 00:00:00 2001 From: christian Date: Mon, 3 May 2021 08:56:28 +0200 Subject: [PATCH] fixed client checks on triggers and added sql db check --- RaceTimer/scripting/unloze_racetimer_redux.sp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RaceTimer/scripting/unloze_racetimer_redux.sp b/RaceTimer/scripting/unloze_racetimer_redux.sp index 46cc3e24..69491200 100644 --- a/RaceTimer/scripting/unloze_racetimer_redux.sp +++ b/RaceTimer/scripting/unloze_racetimer_redux.sp @@ -75,7 +75,7 @@ public void OnPluginStart() public void trigger_teleport(const char[] output, int entity_index, int client, float delay) { - if (IsValidEdict(entity_index) && g_bHumansAllowedTime[client]) + if (IsValidEdict(entity_index) && IsValidClient(client) && g_bHumansAllowedTime[client]) { if (StrContains(g_cMapname, "surf", false) == -1) { @@ -88,7 +88,7 @@ public void trigger_teleport(const char[] output, int entity_index, int client, public void Trigger_Multiple(const char[] output, int entity_index, int client, float delay) { - if (IsValidEdict(entity_index) && origin_command_check(entity_index) && g_bHumansAllowedTime[client]) + if (IsValidEdict(entity_index) && origin_command_check(entity_index) && IsValidClient(client) && g_bHumansAllowedTime[client]) { if (StrContains(g_cMapname, "surf", false) == -1) { @@ -664,6 +664,8 @@ public void insertPlayerMYSQL(int client) GetClientName(client, sName, sizeof(sName)); int size2 = 2 * strlen(sName) + 1; char[] sEscapedName = new char[size2 + 1]; + if (!g_dDatabase) + Database.Connect(SQL_OnDatabaseConnect, "racetimercss"); g_dDatabase.Escape(sName, sEscapedName, size2 + 1); if (StrEqual(sSID, "STEAM_ID_STOP_IGNORING_RETVALS") || StrEqual(sSID, "STEAM_ID_PENDING")) {