Cars with Mysql
#1

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;
}
Reply
#2

have you got the cars created in the tables ?
Reply
#3

Код:
          	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
Reply
#4

Are thanks :b My fail (:
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)