SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/09/2019, 09:33 PM   #1
Fletcher007
Big Clucker
 
Join Date: May 2016
Posts: 90
Reputation: 0
Default Help with mysql

Hello, i need some help with my code.
Cannot load Mysql tables, actualy its loading but after the register acc.
please help me..

Code:
[00:30:22] MapFix by Nexius v2.9.1 loaded (include version).
[00:30:22] - Actors Loaded: 9
[00:30:22] -> DynamicObjects: 10282
[00:30:22] -> StaticObjects: 32
[00:30:22] -> Objects(Streamer): 968
[00:30:22] Number of vehicle models: 67
[00:30:44] [connection] 123123.3.212.1 requests connection cookie.
[00:30:45] [connection] incoming connection: 123123.3.212.1 id: 0
[00:30:45] [join] Test_Test has joined the server (123123.3.212.1)
[00:30:45] [Bussines]: <41>. Loaded: <60 ms>.
[00:30:46] [Houses]: <504>. Loaded: <560 ms>.
[00:30:46] [Mafia Products]: Loaded: <1 ms>.
[00:30:46] [Gang Produqtebi]: Loaded: <1 ms>.
[00:30:46] [ATM Loaded]: <14>. Loaded: <6 ms>.
[00:30:46] [GangZone Loaded]: <132>. Loaded: <49 ms>.
[00:30:46] [E.T.C]: Loaded: <2 ms>.
[00:31:03] Игрок Test_Test Used Dialog 2
[00:31:13] [part] Test_Test has left the server (0:1)

Code:
mysql_tquery(mysql_connect_ID, "SELECT * FROM "T_GANGZONE"", "LoadGZ", "");


function LoadGZ() //test
{
    new time = GetTickCount(), rows;
    cache_get_row_count(rows);

	for(new idx = 1; idx <= rows; idx++)
	{
		cache_get_value_name_int(idx-1, "id", GZInfo[idx][gID]); // id

		cache_get_value_name_float(idx-1, "ginfo1", GZInfo[idx][gCoords][0]); // ginfo1
		cache_get_value_name_float(idx-1, "ginfo2", GZInfo[idx][gCoords][1]); // ginfo2
		cache_get_value_name_float(idx-1, "ginfo3", GZInfo[idx][gCoords][2]); // ginfo3
		cache_get_value_name_float(idx-1, "ginfo4", GZInfo[idx][gCoords][3]); // ginfo4

		cache_get_value_name_int(idx-1, "fraction", GZInfo[idx][gFrak]); // fraction

		TOTALGZ++;

		GZInfo[idx][gID] = GangZoneCreate(GZInfo[idx][gCoords][0],GZInfo[idx][gCoords][1],GZInfo[idx][gCoords][2],GZInfo[idx][gCoords][3]);

		ZoneOnBattle[idx] = 0;
		GZSafeTime[idx] = 0;
		UpdTerrsBand();
	}
	printf("[GangZone Loaded]: <%i>. Daxarjulia: <%i ms>.", TOTALGZ, GetTickCount() - time);
    return true;
}
Fletcher007 is offline   Reply With Quote
Old 21/09/2019, 09:44 PM   #2
Vizi10
Big Clucker
 
Join Date: May 2017
Location: Iran
Posts: 185
Reputation: 2
Default Re: Help with mysql

Have you put 'mysql_tquery' in 'OnGameModeInit'? (after mysql connected or after player registered)
Vizi10 is offline   Reply With Quote
Old 21/09/2019, 09:46 PM   #3
Fletcher007
Big Clucker
 
Join Date: May 2016
Posts: 90
Reputation: 0
Default Re: Help with mysql

yes
Fletcher007 is offline   Reply With Quote
Old 21/09/2019, 09:48 PM   #4
Fletcher007
Big Clucker
 
Join Date: May 2016
Posts: 90
Reputation: 0
Default Re: Help with mysql

Yes..
Fletcher007 is offline   Reply With Quote
Old 22/09/2019, 08:32 AM   #5
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 674
Reputation: 110
Default Re: Help with mysql

Use mysql_query (non-threaded) in `OnGameModeInit`. This will allow all necessary stuff to be loaded before any player connects.
Calisthenics is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket Emre__ Scripting Help 10 30/07/2014 08:26 AM
[Tutorial] [VIDEO] MySQL ORM r38: How to pair GM with MySQL & creation of registration/connection system cArnasLT Tutorials 3 19/05/2014 02:08 PM
[GameMode] MySQL CLEAN GAMEMODE [Whirlpool, MySQL BlueG R7, Cache, Ready Package (Windows)] GiamPy. Gamemode Scripts 13 13/09/2013 04:31 PM
BlueG MySQL plugin - Failed (plugins/mysql.so: undefined symbol: _Z13stringvprintfPKcPc) linuxthefish Plugin Development 10 13/07/2013 10:56 AM
[Tool/Web/Other] MySQL DB Manager - Easily manage your MySQL databases with this remote application fiki574 Tools and Files 13 22/07/2012 09:41 AM


All times are GMT. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.