Load Mysql cars
#1

I'm posting this for my bro, cause he dont have an acc.

Hey, in my old topic i asked u how to save a car -> worked
but now i want to load it and i got some problems.

Код:
stock LoadPlayerCars()
{
    new i;
        new string[6];
    for(; i<= //what here?; i++)
	{
		format(string, sizeof(string), "%d", i);
       format(Playercar[i][owner], MAX_PLAYER_NAME, mysql_GetString("cars", "owner", "id", string));
        Playercar[i][spawnx] = mysql_GetFloat("cars", "spawnx", "id", string);
        Playercar[i][spawny] = mysql_GetFloat("cars", "spawny", "id", string);
        Playercar[i][spawnz] = mysql_GetFloat("cars", "spawnz", "id", string);
        Playercar[i][spawnr] = mysql_GetFloat("cars", "spawnr", "id", string);
        Playercar[i][c1] = mysql_GetInt("cars", "c1", "id", string);
        Playercar[i][c2] = mysql_GetInt("cars", "c2", "id", string);
        format(Playercar[i][plate], 20, "%s", mysql_GetString("cars", "plate", "id", string));
        Playercar[i][modelid] = mysql_GetInt("Cars", "model", "id", string);
        Playercar[i][price] = mysql_GetInt("Cars", "price", "id", string);
        Playercar[i][car] = AddStaticVehicleEx(Playercar[i][modelid], Playercar[i][spawnx], Playercar[i][spawny], Playercar[i][spawnz], Playercar[i][spawnr], Playercar[i][c1], Playercar[i][c2], -1);
        
        printf("i = %d, owner = %s, x = %f, y = %f, z = %f, r = %f, c1 = %d, c2 = %d, plate = %s, model = %d, price = %d, car = %d", i, Playercar[i][modelid], Playercar[i][spawnx], Playercar[i][spawny], Playercar[i][spawnz], Playercar[i][spawnr], Playercar[i][c1], Playercar[i][c2], Playercar[i][plate], Playercar[i][modelid], Playercar[i][price], Playercar[i][car]);
How can i load them? And do u have a good mysql tutorial? Cause i dont get it well.

(sry for bad engl. )
Reply


Messages In This Thread
Load Mysql cars - by yellow - 02.02.2014, 14:05
AW: Load Mysql cars - by yellow - 02.02.2014, 16:45
Re: Load Mysql cars - by Vince - 02.02.2014, 17:17
Re: Load Mysql cars - by PowerPC603 - 02.02.2014, 18:05
AW: Load Mysql cars - by yellow - 02.02.2014, 18:14
Re: Load Mysql cars - by PowerPC603 - 02.02.2014, 18:51
AW: Load Mysql cars - by yellow - 02.02.2014, 18:58
Re: Load Mysql cars - by PowerPC603 - 02.02.2014, 19:00
AW: Load Mysql cars - by yellow - 02.02.2014, 19:02
Re: Load Mysql cars - by PowerPC603 - 02.02.2014, 19:04

Forum Jump:


Users browsing this thread: 1 Guest(s)