fixed client checks on triggers and added sql db check

This commit is contained in:
christian 2021-05-03 08:56:28 +02:00
parent fba464681f
commit 7cf253a076

View File

@ -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"))
{