MySQL - R38 loading houses help
#8

I presume its not putting anything relating to fieldnames/tablenames into the txt file. I'll open up pawno now

Edit:

Using this script:

pawn Код:
new
    Database = 1;
main(){}
public OnGameModeInit()
{
    mysql_log(LOG_ALL,LOG_TYPE_TEXT);
    Database = mysql_connect("localhost","user","testdb","pass");
    mysql_tquery(Database,"SELECT * FROM `houses`","OnHouseLoad");
    return 1;
}
forward OnHouseLoad();
public OnHouseLoad()
{
    if(cache_num_rows())
    {
        for(new i = 0; i<cache_num_rows(); i++)
        {
            new ID = cache_get_field_content_int(i,"id",Database);
            new Float:x =  cache_get_field_content_float(i,"x",Database);
            new Float:y =  cache_get_field_content_float(i,"y",Database);
            new Float:z =  cache_get_field_content_float(i,"z",Database);
            printf("Loaded house %d %f %f %f",ID,x,y,z);
        }
    }
    else print("No houses found.");
    return 1;
}
Outputs:

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3z-R2, ©2005-2014 SA-MP Team

[02:30:27] 
[02:30:27] Server Plugins
[02:30:27] --------------
[02:30:27]  Loading plugin: mysql
[02:30:27]  >> plugin.mysql: R38 successfully loaded.
[02:30:27]   Loaded.
[02:30:27]  Loading plugin: streamer
[02:30:27]   Loaded.
[02:30:27]  Loaded 2 plugins.

[02:30:27] 
[02:30:27] Filterscripts
[02:30:27] ---------------
[02:30:27]   Loaded 0 filterscripts.

[02:30:27] Number of vehicle models: 0
[02:30:27] Loaded house 1 123.000000 456.000000 789.000000
Reply


Messages In This Thread
MySQL - R38 loading houses help - by vernz - 23.04.2014, 00:03
Re: MySQL - R38 loading houses help - by DobbysGamertag - 23.04.2014, 00:07
Re : MySQL - R38 loading houses help - by vernz - 23.04.2014, 00:15
Re: MySQL - R38 loading houses help - by DobbysGamertag - 23.04.2014, 00:20
Re : MySQL - R38 loading houses help - by vernz - 23.04.2014, 00:30
Re: MySQL - R38 loading houses help - by DobbysGamertag - 23.04.2014, 01:06
Re : MySQL - R38 loading houses help - by vernz - 23.04.2014, 01:07
Re: MySQL - R38 loading houses help - by DobbysGamertag - 23.04.2014, 01:09
Re : MySQL - R38 loading houses help - by vernz - 23.04.2014, 01:14
Re: MySQL - R38 loading houses help - by DobbysGamertag - 23.04.2014, 01:19

Forum Jump:


Users browsing this thread: 1 Guest(s)