Hallo
Also ich habe seit heute morgen ein Problem. Der Server startet, aber die Einstellungen, welche ich bei OnGameModeInti gesetzt habe (Man sieht sich auf der Map nicht, Limited Radius für Gespräche), werden nicht geladen. Ich habe vorhin einen Code, um was aus der MySQL Tabelle zu laden. Nun habe ich dort womöglich einen Fehler. Wenn ich LoadVehicles im Ladecode unter OnGameModeInit ausklammere geht alles, von dem her liegt dort das Problem.
OnGameModeInit-Code:
mysql_init(LOG_ALL);
mysql_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
//Fahrzeugsystem für den Server
for(new Carid=0; Carid<1000; Carid++)
{
format(query, sizeof(query), "SELECT * FROM `Vehicles` WHERE CarID = '%d';",Carid);
mysql_query(query);
mysql_store_result();
// LoadVehicle(Carid);
mysql_free_result();
}
LoadVehicles-Code:
LoadVehicle(Carid)
{
new data[256];
format(query, sizeof(query), "SELECT * FROM `Vehicles` WHERE CarID = '%d';",Carid);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
mysql_fetch_field("CarID",data);
VehicleSystem[Carid][CarID]=strval(data);
mysql_fetch_field("Model",data);
VehicleSystem[Carid][Model]=strval(data);
mysql_fetch_field("Locked",data);
VehicleSystem[Carid][Locked]=strval(data);
mysql_fetch_field("CFrak",data);
VehicleSystem[Carid][Fraktion]=strval(data);
mysql_fetch_field("CJob",data);
VehicleSystem[Carid][Beruf]=strval(data);
mysql_fetch_field("CNoob",data);
VehicleSystem[Carid][Noob]=strval(data);
mysql_fetch_field("CVer",data);
VehicleSystem[Carid][Verwahrt]=strval(data);
mysql_fetch_field("CTun",data);
VehicleSystem[Carid][Tunebar]=strval(data);
mysql_fetch_field("CarX",data);
VehicleSystem[Carid][Carx]=strval(data);
mysql_fetch_field("CarY",data);
VehicleSystem[Carid][Cary]=strval(data);
mysql_fetch_field("CarZ",data);
VehicleSystem[Carid][Carz]=strval(data);
mysql_fetch_field("CarA",data);
VehicleSystem[Carid][Cara]=strval(data);
mysql_fetch_field("AdacX",data);
VehicleSystem[Carid][Adacx]=strval(data);
mysql_fetch_field("AdacY",data);
VehicleSystem[Carid][Adacy]=strval(data);
mysql_fetch_field("AdacZ",data);
VehicleSystem[Carid][Adacz]=strval(data);
mysql_fetch_field("AdacA",data);
VehicleSystem[Carid][Adaca]=strval(data);
mysql_fetch_field("Color1",data);
VehicleSystem[Carid][Color1]=strval(data);
mysql_fetch_field("Color2",data);
VehicleSystem[Carid][Color2]=strval(data);
mysql_fetch_field("Price",data);
VehicleSystem[Carid][Price]=strval(data);
mysql_fetch_field("Sell",data);
VehicleSystem[Carid][Sell]=strval(data);
mysql_fetch_field("Owner",data);
strmid(VehicleSystem[Carid][Owner],data,0,20,20);
mysql_fetch_field("PJ",data);
VehicleSystem[Carid][Pj]=strval(data);
mysql_fetch_field("T0",data);
VehicleSystem[Carid][Tt0]=strval(data);
mysql_fetch_field("T1",data);
VehicleSystem[Carid][Tt1]=strval(data);
mysql_fetch_field("T2",data);
VehicleSystem[Carid][Tt2]=strval(data);
mysql_fetch_field("T3",data);
VehicleSystem[Carid][Tt3]=strval(data);
mysql_fetch_field("T4",data);
VehicleSystem[Carid][Tt4]=strval(data);
mysql_fetch_field("T5",data);
VehicleSystem[Carid][Tt5]=strval(data);
mysql_fetch_field("T6",data);
VehicleSystem[Carid][Tt6]=strval(data);
mysql_fetch_field("T7",data);
VehicleSystem[Carid][Tt7]=strval(data);
mysql_fetch_field("T8",data);
VehicleSystem[Carid][Tt8]=strval(data);
mysql_fetch_field("T9",data);
VehicleSystem[Carid][Tt9]=strval(data);
mysql_fetch_field("T10",data);
VehicleSystem[Carid][Tt10]=strval(data);
mysql_fetch_field("T11",data);
VehicleSystem[Carid][Tt11]=strval(data);
mysql_fetch_field("T12",data);
VehicleSystem[Carid][Tt12]=strval(data);
mysql_fetch_field("T13",data);
VehicleSystem[Carid][Tt13]=strval(data);
new carr = CreateVehicle(VehicleSystem[Carid][Model],VehicleSystem[Carid][Carx],VehicleSystem[Carid][Cary],VehicleSystem[Carid][Carz]+1,VehicleSystem[Carid][Cara],VehicleSystem[Carid][Color1],VehicleSystem[Carid][Color2],600000);
IsBuyableCar[carr]=Carid;
SetVehicleTuning(carr);
AutoCounter ++;
}
mysql_free_result();
return 1;
}
Wäre um Hilfe sehr froh, da es momentan auf dem Server keine Fahrzeuge gibt
MfG dUDALUS