Quote:
Originally Posted by Nachtfrische
You also might want to account for the Steam ID being "STEAM_ID_PENDING" sometimes, so make sure you filter it out somehow.
|
Don't filter such things, just do things properly:
->
https://github.com/yash1441/DailyCre...s_mysql.sp#L56
->
https://github.com/yash1441/DailyCre...s_mysql.sp#L79
Bad code:
Code:
GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId));
char buffer[200];
Format(buffer, sizeof(buffer), "SELECT * FROM players WHERE steam_id = '%s'", steamId);
Good code would be like:
Code:
if (GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId))) {
/* Do what you want with the Steam ID here */
}
GetClientAuthId returns TRUE if a proper Steam ID was received, so therefore, put it in a IF to make sure.
Not checking / validating the data you receive properly ... usually leads to strange results.
__________________