Raised This Month: $ Target: $400
 0% 

[HELP] Saving Player steamid to SQL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SANTO37
Member
Join Date: Aug 2008
Old 06-30-2018 , 05:34   Re: [HELP] Saving Player steamid to SQL
Reply With Quote #1

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?
SANTO37 is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 06-30-2018 , 05:58   Re: [HELP] Saving Player steamid to SQL
Reply With Quote #2

Quote:
Originally Posted by SANTO37 View Post
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?
Ok, so right now your plugin works like this:
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
Kushfield is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode