[19:03:42] >> mysql_query( Connection handle: 1 ) [19:03:42] CMySQLHandler::Query(SELECT * FROM vehicles WHERE ID = '0') - Successfully executed. [19:03:42] >> mysql_store_result( Connection handle: 1 ) [19:03:42] CMySQLHandler::StoreResult() - Result was stored. [19:03:42] >> mysql_retrieve_row( Connection handle: 1 ) [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("ID") - 0 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Model") - 560 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("PosX") - 1582.21 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("PosY") - -1303.5 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("PosZ") - 17.3694 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Angle") - 0 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Interior") - 0 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("World") - 0 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Color1") - 1 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Color2") - 1 [19:03:42] >> mysql_fetch_field_row( Connection handle: 1 ) [19:03:42] CMySQLHandler::FetchField("Faction") - 0 [19:03:42] >> mysql_free_result( Connection handle: 1 ) [19:03:42] CMySQLHandler::FreeResult() - Result was successfully free'd. |
public LoadVehicles(vehid)
{
format(mainstring,sizeof(mainstring),"SELECT * FROM vehicles WHERE ID = '%d'",vehid);
mysql_query(mainstring);
mysql_store_result();
new result[64];
if(mysql_retrieve_row())
{
mysql_fetch_field_row(result,"ID");
VehicleInfo[vehid][cID] = strval(result);
mysql_fetch_field_row(result,"Model");
VehicleInfo[vehid][cID] = strval(result);
mysql_fetch_field_row(result,"PosX");
VehicleInfo[vehid][cPosX] = floatstr(result);
mysql_fetch_field_row(result,"PosY");
VehicleInfo[vehid][cPosY] = floatstr(result);
mysql_fetch_field_row(result,"PosZ");
VehicleInfo[vehid][cPosZ] = floatstr(result);
mysql_fetch_field_row(result,"Angle");
VehicleInfo[vehid][cAngle] = floatstr(result);
mysql_fetch_field_row(result,"Interior");
VehicleInfo[vehid][cInterior] = strval(result);
mysql_fetch_field_row(result,"World");
VehicleInfo[vehid][cWorld] = strval(result);
mysql_fetch_field_row(result,"Color1");
VehicleInfo[vehid][cColor1] = strval(result);
mysql_fetch_field_row(result,"Color2");
VehicleInfo[vehid][cColor2] = strval(result);
mysql_fetch_field_row(result,"Faction");
VehicleInfo[vehid][cFaction] = strval(result);
VehicleInfo[vehid][cAlarm] = 0;
VehicleInfo[vehid][cEngine] = 0;
VehicleInfo[vehid][cFuel] = 100.0;
AddStaticVehicle(VehicleInfo[vehid][cModel],VehicleInfo[vehid][cPosX],VehicleInfo[vehid][cPosY],VehicleInfo[vehid][cPosZ],VehicleInfo[vehid][cAngle],VehicleInfo[vehid][cColor1],VehicleInfo[vehid][cColor2]);
LinkVehicleToInterior(vehid,VehicleInfo[vehid][cInterior]);
SetVehicleVirtualWorld(vehid,VehicleInfo[vehid][cWorld]);
}
mysql_free_result();
return 1;
}
public LoadVehicles()
{
mysql_query("SELECT * FROM vehicles");
mysql_store_result();
new result[64], vehid;
while(mysql_retrieve_row())
{
vehid ++;
mysql_fetch_field_row(result,"ID");
VehicleInfo[vehid][cID] = strval(result);
mysql_fetch_field_row(result,"Model");
VehicleInfo[vehid][cID] = strval(result);
mysql_fetch_field_row(result,"PosX");
VehicleInfo[vehid][cPosX] = floatstr(result);
mysql_fetch_field_row(result,"PosY");
VehicleInfo[vehid][cPosY] = floatstr(result);
mysql_fetch_field_row(result,"PosZ");
VehicleInfo[vehid][cPosZ] = floatstr(result);
mysql_fetch_field_row(result,"Angle");
VehicleInfo[vehid][cAngle] = floatstr(result);
mysql_fetch_field_row(result,"Interior");
VehicleInfo[vehid][cInterior] = strval(result);
mysql_fetch_field_row(result,"World");
VehicleInfo[vehid][cWorld] = strval(result);
mysql_fetch_field_row(result,"Color1");
VehicleInfo[vehid][cColor1] = strval(result);
mysql_fetch_field_row(result,"Color2");
VehicleInfo[vehid][cColor2] = strval(result);
mysql_fetch_field_row(result,"Faction");
VehicleInfo[vehid][cFaction] = strval(result);
VehicleInfo[vehid][cAlarm] = 0;
VehicleInfo[vehid][cEngine] = 0;
VehicleInfo[vehid][cFuel] = 100.0;
AddStaticVehicle(VehicleInfo[vehid][cModel],VehicleInfo[vehid][cPosX],VehicleInfo[vehid][cPosY],VehicleInfo[vehid][cPosZ],VehicleInfo[vehid][cAngle],VehicleInfo[vehid][cColor1],VehicleInfo[vehid][cColor2]);
LinkVehicleToInterior(vehid,VehicleInfo[vehid][cInterior]);
SetVehicleVirtualWorld(vehid,VehicleInfo[vehid][cWorld]);
}
mysql_free_result();
return 1;
}
Tried that bud but it's still not spawning the vehicles, unfortunately.
|
19:38:46] CMySQLHandler::Query(SELECT * FROM vehicles) - Successfully executed. [19:38:46] >> mysql_store_result( Connection handle: 1 ) [19:38:46] CMySQLHandler::StoreResult() - Result was stored. [19:38:46] >> mysql_retrieve_row( Connection handle: 1 ) [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("ID") - 1 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Model") - 560 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosX") - -352.641 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosY") - 1529.25 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosZ") - 75.3594 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Angle") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Interior") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("World") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Color1") - 1 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Color2") - 1 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Faction") - 0 [19:38:46] >> mysql_retrieve_row( Connection handle: 1 ) [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("ID") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Model") - 560 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosX") - 1779.37 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosY") - 1454.54 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("PosZ") - 13.487 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Angle") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Interior") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("World") - 0 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Color1") - 1 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Color2") - 1 [19:38:46] >> mysql_fetch_field_row( Connection handle: 1 ) [19:38:46] CMySQLHandler::FetchField("Faction") - 0 [19:38:46] >> mysql_retrieve_row( Connection handle: 1 ) [19:38:46] >> mysql_free_result( Connection handle: 1 ) [19:38:46] CMySQLHandler::FreeResult() - Result was successfully free'd.
AddStaticVehicle(560,-386.8285,1544.1665,75.1139,359.9987,3,3); //
public LoadVehicles()
{
new i;
mysql_query("SELECT * FROM vehicles");
mysql_store_result();
new field[128][128];
if(mysql_num_rows() != 0)
{
VehicleInfo[i][cID] = strval(field[0]);
VehicleInfo[i][cModel] = strval(field[1]);
VehicleInfo[i][cPosX] = floatstr(field[2]);
VehicleInfo[i][cPosY] = floatstr(field[3]);
VehicleInfo[i][cPosZ] = floatstr(field[4]);
VehicleInfo[i][cAngle] = floatstr(field[5]);
VehicleInfo[i][cInterior] = strval(field[6]);
VehicleInfo[i][cWorld] = strval(field[7]);
VehicleInfo[i][cColor1] = strval(field[8]);
VehicleInfo[i][cColor2] = strval(field[9]);
VehicleInfo[i][cFaction] = strval(field[10]);
VehicleInfo[i][cAlarm] = 0;
VehicleInfo[i][cEngine] = 0;
VehicleInfo[vehid][cFuel] = 100.0;
AddStaticVehicle(VehicleInfo[i][cModel],VehicleInfo[i][cPosX],VehicleInfo[i][cPosY],VehicleInfo[i][cPosZ],VehicleInfo[i][cAngle],VehicleInfo[i][cColor1],VehicleInfo[i][cColor2]);
LinkVehicleToInterior(i,VehicleInfo[i][cInterior]);
SetVehicleVirtualWorld(i,VehicleInfo[i][cWorld]);
}
mysql_free_result();
return 1;
}
public LoadVehicles()
{
for(new i=1; i<MAX_VEHICLE; i++)//edit the max_vehicle to urs
{
mysql_query("SELECT * FROM vehicles WHERE ID = '%d'",i);
mysql_store_result();
new field[128][128];
if(mysql_num_rows() != 0)
{
VehicleInfo[i][cID] = strval(field[0]);
VehicleInfo[i][cModel] = strval(field[1]);
VehicleInfo[i][cPosX] = floatstr(field[2]);
VehicleInfo[i][cPosY] = floatstr(field[3]);
VehicleInfo[i][cPosZ] = floatstr(field[4]);
VehicleInfo[i][cAngle] = floatstr(field[5]);
VehicleInfo[i][cInterior] = strval(field[6]);
VehicleInfo[i][cWorld] = strval(field[7]);
VehicleInfo[i][cColor1] = strval(field[8]);
VehicleInfo[i][cColor2] = strval(field[9]);
VehicleInfo[i][cFaction] = strval(field[10]);
VehicleInfo[i][cAlarm] = 0;
VehicleInfo[i][cEngine] = 0;
VehicleInfo[vehid][cFuel] = 100.0;
AddStaticVehicle(VehicleInfo[i][cModel],VehicleInfo[i][cPosX],VehicleInfo[i][cPosY],VehicleInfo[i][cPosZ],VehicleInfo[i][cAngle],VehicleInfo[i][cColor1],VehicleInfo[i][cColor2]);
LinkVehicleToInterior(i,VehicleInfo[i][cInterior]);
SetVehicleVirtualWorld(i,VehicleInfo[i][cWorld]);
}
mysql_free_result();
}
return 1;
}
You have Define MAX_VEHICLES or w/e on top of your script? if not just add
pawn Код:
pawn Код:
|