is that only me or not that in the code is still using deprecated GetClientAuthString? :/
Should be from this..
Quote:
GetClientAuthString(client, auth, sizeof(auth));
|
to this..
Quote:
GetClientAuthId(client, AuthId_Steam2, auth, sizeof(auth));
|
-----
GetClientName will return string but not an integer number.
https://sm.alliedmods.net/api/index....ad=show&id=399
Quote:
GetClientName(client, PlayerName[client],sizeof(PlayerName));
Format(query, sizeof(query), "UPDATE srank SET name = %d,kills = %d,deaths = %d,headshots = %d, points = %d WHERE steamid = '%s'",PlayerName[client],PlayerKills[client],PlayerDeaths[client],PlayerHeadShots[client],PlayerPoints[client],auth);
|
I see you are trying to get a playername from the client index with GetClientName (correct me if i was wrong), but in sourcemod format specifier ,you can convert client index to playername string simply with %N, so the code would be like that:
Code:
Format(query, sizeof(query), "UPDATE srank SET name = '%N',kills = %d,deaths = %d,headshots = %d, points = %d WHERE steamid = '%s'",client,PlayerKills[client],PlayerDeaths[client],PlayerHeadShots[client],PlayerPoints[client],auth);
*EscapeString or else it 'll Vulnerable to SQL attack
Thanks!
__________________