SA-MP Forums Archive
[MySQL] Need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [MySQL] Need Help (/showthread.php?tid=162455)



[MySQL] Need Help - Avice - 23.07.2010

i have code:
Код:
#include <mysql>

public OnGameModeInit()
{
   mysql_log(1);


   mysql_connect("localhost", "root", "SLAPTA", "samp");
mysql_query("SELECT * FROM car");
mysql_store_result();
new Data[50];
if(mysql_num_rows() > 0) {
    while(mysql_fetch_row(Data, "|")) {
          print(Data);
    }
}
mysql_free_result();
   return 1;
}
wheen i on server i get mysql_log.txt:

Код:
Connected (0) to root @ localhost via TCP/IP. MySQL version 5.0.16-nt.

[01/01/02 03:44:35] Function: 'mysql_query' executed: "SELECT * FROM car" with result: "0".

[01/01/02 03:44:35] Function: 'mysql_num_rows' called with result: "1".

[01/01/02 03:44:35] Function: 'mysql_fetch_row' called with result: "AddStaticVehicle(587,2049.7656,1528.6237,10.3977,270.1695,53,1); // ".
server log.txt :
Код:
v0.3a R8, ©2005-2010 SA-MP Team

[03:44:35] 
[03:44:35] Server Plugins
[03:44:35] --------------
[03:44:35]  Loading plugin: mysql
[03:44:35]  SA:MP MySQL Plugin 1.2.1 Loaded.
[03:44:35]   Loaded.
[03:44:35]  Loaded 1 plugins.

[03:44:35] MySQL: Query thread running. Thread safe: Yes.
[03:44:35] 
[03:44:35] Filter Scripts
[03:44:35] ---------------
[03:44:35]   Loading filter script 'base.amx'...
[03:44:35] 
--Base FS loaded.

[03:44:35]   Loading filter script 'gl_actions.amx'...
[03:44:35]   Loading filter script 'gl_property.amx'...
[03:44:35] 
-----------------------------------
[03:44:35] Grand Larceny Property Filterscript		
[03:44:35] -----------------------------------

[03:44:35]   Loading filter script 'gl_realtime.amx'...
[03:44:35]   Loading filter script 'medit.amx'...
[03:44:35]  
[03:44:35]     San Andreas: Map Editor
[03:44:35]     by mabako
[03:44:35]  
[03:44:35]   Loading filter script 'vartai.amx'...
[03:44:35]   Loaded 6 filter scripts.

[03:44:35] MySQL: Connected (0) to root @ localhost via TCP/IP. MySQL version 5.0.16-nt.
[03:44:35] AddStaticVehicle(587,2049.7656,1528.6237,10.3977,270.1695,53,1); // 
[03:44:35] Reading File: blank
[03:44:35] Reading File: properties/houses.txt
[03:44:35] Reading File: properties/businesses.txt
[03:44:35] Reading File: properties/banks.txt
[03:44:35] Reading File: properties/police.txt
[03:44:35] 
----------------------------------
[03:44:35]   Running LVDM ~MoneyGrub

[03:44:35]          Coded By
[03:44:35]             Jax
[03:44:35] ----------------------------------
Why no add car in game?
what wrong?


Re: [MySQL] Need Help - TransformerOwl - 23.07.2010

The code has no AddStaticVehicle, CreateVehicle or any other form of creating a vehicle included. You need to get the vehicle's data from MySQL (not the PAWN runtime line) or it will be pretty much useless since your gamemode is PRECOMPILED!