AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how do you wait for sql to connect before doing an action? (https://forums.alliedmods.net/showthread.php?t=12836)

slurpycof 04-26-2005 09:26

how do you wait for sql to connect before doing an action?
 
I have this task to connect to the sql database
Code:
set_task(0.1,"sql_init")

and then I am using public client_authorized(id){ to execute code and read data from the database.

The problem that I am having is that users that connect right away on a map change give an error like this
Code:

L 04/25/2005 - 20:07:20: [AMXX] Run time error 10 (native) (plugin "frequentfraggerprogram.amxx") - debug not enabled.
L 04/25/2005 - 20:07:20: [MYSQL] Invalid database handle -1
L 04/25/2005 - 20:07:20: [AMXX] To enable debug mode, add " debug" after the plugin name in plugins.ini (without quotes).
L 04/25/2005 - 20:07:20: [AMXX] Run time error 10 (native) (plugin "frequentfraggerprogram.amxx") - debug not enabled.
L 04/25/2005 - 20:07:20: [MYSQL] Invalid result handle -6

How would I delay them connecting until the database is connected so that the plugin can read their data?


All times are GMT -4. The time now is 16:40.

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