[HELP] Saving Player steamid to SQL
Hi, I have made a website. I need to record the SteamId information of the players in the base. The steam information will be saved to the database when you write the number / steam.
If the database does not have steam information of the player; PHP Code:
PHP Code:
In the following code, the information is not saved immediately and the information of other players is added. This code is not working properly; PHP Code:
|
Re: [HELP] Saving Player steamid to SQL
I didn't really understand what the problem is, but maybe this is the cause?
PHP Code:
If that's not it, could you please explain what you mean by "In the following code, the information is not saved immediately and the information of other players is added." or what the exact issue is with the code. |
Re: [HELP] Saving Player steamid to SQL
Simply because you have closed the connection , create the tuple and the connection in plugin init.
And dont free them until plugin ends |
Re: [HELP] Saving Player steamid to SQL
I created a website where players can subscribe.
They have to enter the game [say / steam] and register their steamid address. However, the plugin registers all the players' data at the same time. I just want [say / steam] to be registered. The player registers after logging out from the server. What do I have to do to register? |
Re: [HELP] Saving Player steamid to SQL
Quote:
|
Re: [HELP] Saving Player steamid to SQL
Plugin... Could you write it all over again?
|
Re: [HELP] Saving Player steamid to SQL
Quote:
1. Do nothing except generate errors until someone joins and writes /v (MySql_Init) 2. When a player joins, check if his/her name exists in the database table 3. If it doesn't, insert a new record with the player's information Assuming you want it to: 1. When a player writes /steam, check if his/her SteamID exists in the database table 2. If it doesn't, insert a new record with the player's information You should: 1. Add "MySql_Init()" directly in plugin_init() instead of registering it as a command, so that the database connection information is always available via g_SqlTuple 2. Register the "say /steam" client command instead, setting Load_MySql as it's handling function 3. Remove "Load_MySql(id)" from client_putinserver |
Re: [HELP] Saving Player steamid to SQL
Excellent !
But I want the [say / steam] command to work. You could ask me if you could. I'm new. |
Re: [HELP] Saving Player steamid to SQL
PHP Code:
|
Re: [HELP] Saving Player steamid to SQL
Quote:
PHP Code:
I see you did that already. Not sure what it is you're asking for then. By the way, you're still checking for the existence of Name, not SteamID in the table. Maybe that's the intention, but according to your description, it doesn't seem like it. |
| All times are GMT -4. The time now is 12:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.