SA-MP Forums Archive
Cars with Mysql - 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: Cars with Mysql (/showthread.php?tid=196991)



Cars with Mysql - Xivop. - 07.12.2010

Why my Script dont Create the Cars ?

Код:
public AutosLaden(vehicleid,playerid)
{
    new Query[200];
    format(Query, sizeof(Query), "SELECT * FROM `autos`");
    mysql_query(Query);
    mysql_store_result();
    new line[300];
    if(mysql_fetch_row(line))
    	{
     		new data[7];
       		sscanf(line, "ddddddd", data[0],data[1],data[2],data[3],data[4],data[5],data[6]);
          	SetPVarInt(playerid, "carid", data[0]);
          	SetPVarInt(playerid, "posx", data[1]);
          	SetPVarInt(playerid, "posy", data[2]);
          	SetPVarInt(playerid, "posz", data[3]);
          	SetPVarInt(playerid, "poszy", data[4]);
          	SetPVarInt(playerid, "farbe1", data[5]);
          	SetPVarInt(playerid, "farbe2", data[6]);
            mysql_free_result();
            AddStaticVehicle(data[0],data[1],data[2],data[3],data[4],data[5],data[6]);
          }
	return 1;
}



Re: Cars with Mysql - universe - 07.12.2010

have you got the cars created in the tables ?


Re: Cars with Mysql - armyoftwo - 07.12.2010

Код:
          	SetPVarFloat(playerid, "posx", data[1]);
          	SetPVarFloat(playerid, "posy", data[2]);
          	SetPVarFloat(playerid, "posz", data[3]);
          	SetPVarFloat(playerid, "poszy", data[4]);
Shouldn't they be SetPVarFloat?
and look at mysql log file

and make sure that

data[1]
data[2]
data[3]
data[4]

are floats


AW: Cars with Mysql - Xivop. - 07.12.2010

Are thanks :b My fail (: