Open stefanx111 opened 1 year ago
@stefanx111
in vip/Clients.sp I did something like this and if you look in log at PrintToServer
you see that the accountid is displayed when GetSteamAccountID
have false
argument
void Clients_LoadClient(int iClient, bool bNotify)
{
char szQuery[512], steamid[32], steamid2[32];
int iAccountID = GetSteamAccountID(iClient);
int iAccountID2 = GetSteamAccountID(iClient, false);
GetClientAuthId(iClient, AuthId_Steam3, steamid2, sizeof(steamid2), false);
GetClientAuthId(iClient, AuthId_Steam3, steamid, sizeof(steamid), true);
PrintToServer("%L %s GetClientAuthId - false) (%s GetClientAuthId - true) (%i GetSteamAccountID - true) (%i GetSteamAccountID - false)", iClient, steamid2, steamid, iAccountID, iAccountID2 );
DBG_Clients("Clients_LoadClient %N (%d), %b: - > %x, %u", iClient, iClient, g_iClientInfo[iClient], g_hDatabase, g_hDatabase)
char szWhere[64];
if(g_szSID[0])
{
#if USE_MORE_SERVERS 1
FormatEx(SZF(szWhere), " AND (`sid` = %d OR `sid` = 0)", g_CVAR_iServerID);
#else
strcopy(SZF(szWhere), g_szSID);
#endif
}
FormatEx(SZF(szQuery), "SELECT `expires`, `group`, `name` \
FROM `vip_users` \
WHERE `account_id` = %d%s LIMIT 1;",
iAccountID, szWhere);
DataPack hDataPack = new DataPack();
hDataPack.WriteCell(UID(iClient));
hDataPack.WriteCell(iAccountID);
hDataPack.WriteCell(bNotify);
DBG_SQL_Query(szQuery)
g_hDatabase.Query(SQL_Callback_OnClientAuthorized, szQuery, hDataPack);
}
L 03/05/2023 - 14:03:00: [vip/VIP_Core.smx] [VIP] Clients: OnClientPutInServer toosii -_- (19): 0
L 03/05/2023 - 14:03:00: [vip/VIP_Core.smx] [VIP] Clients: Clients_LoadClient toosii -_- (19), 10: - > e7a00876, 3886024822
L 03/05/2023 - 14:03:00: [vip/VIP_Core.smx] [VIP] SQL_Query: SELECT `expires`, `group`, `name` FROM `vip_users` WHERE `account_id` = 0 AND `sid` = 0 LIMIT 1;
toosii -_-<196><STEAM_ID_PENDING><> [U:1:1312035860] GetClientAuthId - false) (STEAM_ID_STOP_IGNORING_RETVALS GetClientAuthId - true) (0 GetSteamAccountID - true) (1312035860 GetSteamAccountID - false)
@stefanx111
try compile with
int iAccountID = GetSteamAccountID(iClient, false);
this should help, but other problems may appear
Why sometimes the player doesn't get the vip when connect? I think the problem is that
account_id
is 0 This player has vip butIS_VIP = 0
I have to refresh vip to make it work.Debug-VIPCore-3.0.4R