From cbb9cc58171797f1a4a8791bb6be8cb3e2a7d888 Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 14 Nov 2024 20:37:12 +0100 Subject: [PATCH] we had a guy without steam ID stored in here. caused the python part to crash --- event_rewards/scripting/trackwinners.sp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/event_rewards/scripting/trackwinners.sp b/event_rewards/scripting/trackwinners.sp index 55c95f9f..23815a38 100644 --- a/event_rewards/scripting/trackwinners.sp +++ b/event_rewards/scripting/trackwinners.sp @@ -64,10 +64,16 @@ public void write_reward_entry(int client, char[] event_map) g_hDatabase.Escape(sName, sEscapedName, size2 + 1); char SID[64]; - GetClientAuthId(client, AuthId_Steam2, SID, sizeof(SID)); - Format(sQuery, sizeof(sQuery), "INSERT INTO `rewards` (`steamid`, `username`, `event_map`, `event_reward_days`, `admin_created_reward_steamid`, `admin_created_reward_name`) VALUES ('%s', '%s', '%s', '%i', '%s', '%s')", SID, sEscapedName, event_map, g_ireward_days, g_cadmin_sid, g_cadmin_escaped_name); - g_hDatabase.Query(DummyCallback, sQuery, DBPrio_Normal); - PrintToChat(client, "Your %i days VIP were stored for winning this round. They will be awarded in the next 2-3 hours if you have a forum account.", g_ireward_days); + if (GetClientAuthId(client, AuthId_Steam2, SID, sizeof(SID))) + { + Format(sQuery, sizeof(sQuery), "INSERT INTO `rewards` (`steamid`, `username`, `event_map`, `event_reward_days`, `admin_created_reward_steamid`, `admin_created_reward_name`) VALUES ('%s', '%s', '%s', '%i', '%s', '%s')", SID, sEscapedName, event_map, g_ireward_days, g_cadmin_sid, g_cadmin_escaped_name); + g_hDatabase.Query(DummyCallback, sQuery, DBPrio_Normal); + PrintToChat(client, "Your %i days VIP were stored for winning this round. They will be awarded in the next 2-3 hours if you have a forum account.", g_ireward_days); + } + else + { + PrintToChat(client, "So sorry but your steam ID is not working. no vip for you."); + } } public void DummyCallback(Handle hOwner, Handle hChild, const char[] err, any data)