Loading player's name on client_putinserver returns null (maybe?)
Hey, I'm working on a plugin that records the time played by a player, I load his saved timeplayed from a database at client_putinserver , but sometimes it returns 0, and the timeplayed resets , I think the problem may be that get_user_name on putinserver return null and when I try to load his played time from the database , it returns 0.
On client_putinserver , it loads the timeplayed, saved in a database. PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: Loading player's name on client_putinserver returns null (maybe?)
I had this problem too when using client_putinserver.
Try using client_connect instead - I haven't experienced any issues ever since I switched to it. |
Re: Loading player's name on client_putinserver returns null (maybe?)
Quote:
|
Re: Loading player's name on client_putinserver returns null (maybe?)
adding a delay of 0.2sec for example on putinserver can fix it, i think
also when doing Update time of the players in the round_end, isnt it better to have one Query for updating all players than 32 queries for each player? |
Re: Loading player's name on client_putinserver returns null (maybe?)
Quote:
|
Re: Loading player's name on client_putinserver returns null (maybe?)
you are doing loop through all players...i tryed to tell you: do one query with the loop into that query, but whatever..
also about colum which is named Name, if i remember correctly some years ago Bugsy stated to better change its name reason: mysql by default has something with column 'name' or something like solution: change column name |
Re: Loading player's name on client_putinserver returns null (maybe?)
Quote:
PHP Code:
|
Re: Loading player's name on client_putinserver returns null (maybe?)
Any player-specific data should be based on SteamID and then you would use client_authorized().
|
Re: Loading player's name on client_putinserver returns null (maybe?)
Loop through using get_players array with these flags ch
Also you should check if player is connected first before checking if he's Bot in standard player loop the thing is the native might result in an error not continuing the rest of the code. Also instead of passing the id in the data of the thread query you should pass the name directly since if you have too many queries and it needs to take an amount of time to execute and in that time the player leaves (disconnect) the data is longer saved. Unless some1 else joined in his slot. Also seems like you are getting the value of the wrong column SQL_ReadResult(query, 1) column One is for the name right? If I'm not mistaken? |
Re: Loading player's name on client_putinserver returns null (maybe?)
Quote:
I'll change the column name in nickname , because someone pointed it out that it may be a problem. |
| All times are GMT -4. The time now is 17:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.