Guten Tag,
In der Datenbank sind Fahrzeuge eingetragen abersie werden nicht geladen/erstellt...
Hier mein code:
stock OnCheckFraktionCars()
{
//new query[128];
//format(query,sizeof(query),"SELECT * FROM `fraktioncars`");
mysql_function_query(sqlcon,"SELECT * FROM `fraktioncars`",true,"OnLoadFraktionCars","");
}
public OnLoadFraktionCars()
{
new num_rows, num_fields;
cache_get_data(num_rows, num_fields);
if(!num_rows)return 1;
for(new idx =0; idx < MAX_FRAKCARS; idx ++)
{
new output[32];
cache_get_field_content(0,"SQLid",output);
fInfo[idx][fSQLid] = strval(output);
{
new num_rows, num_fields;
cache_get_data(num_rows, num_fields);
if(!num_rows)return 1;
for(new idx =0; idx < MAX_FRAKCARS; idx ++)
{
new output[32];
cache_get_field_content(0,"SQLid",output);
fInfo[idx][fSQLid] = strval(output);
cache_get_field_content(0,"Model",output);
fInfo[idx][fModelID] = strval(output);
fInfo[idx][fModelID] = strval(output);
cache_get_field_content(0,"FraktionsID",output);
fInfo[idx][fFrakID] = strval(output);
fInfo[idx][fFrakID] = strval(output);
cache_get_field_content(0,"PosX",output);
fInfo[idx][f_X] = floatstr(output);
fInfo[idx][f_X] = floatstr(output);
cache_get_field_content(0,"PosY",output);
fInfo[idx][f_Y] = floatstr(output);
fInfo[idx][f_Y] = floatstr(output);
cache_get_field_content(0,"PosZ",output);
fInfo[idx][f_Z] = floatstr(output);
fInfo[idx][f_Z] = floatstr(output);
cache_get_field_content(0,"PosR",output);
fInfo[idx][f_R] = floatstr(output);
fInfo[idx][f_R] = floatstr(output);
cache_get_field_content(0,"Color",output);
fInfo[idx][fColor][0] = strval(output);
fInfo[idx][fColor][0] = strval(output);
cache_get_field_content(0,"Color2",output);
fInfo[idx][fColor][1] = strval(output);
fInfo[idx][fColor][1] = strval(output);
cache_get_field_content(0,"Tank",output);
fInfo[idx][Tank] = strval(output);
fInfo[idx][Tank] = strval(output);
cache_get_field_content(0,"UmParken",output);
fInfo[idx][UmParken] = strval(output);
if(fInfo[idx][fModelID] >= 400 && fInfo[idx][fModelID] <= 611)
{
fInfo[idx][fCarid] = CreateVehicle(fInfo[idx][fModelID],fInfo[idx][f_X],fInfo[idx][f_Y],fInfo[idx][f_Z],fInfo[idx][f_R],fInfo[idx][fColor][0],fInfo[idx][fColor][1], -1);
Benzin[fInfo[idx][fCarid]] = fInfo[idx][Tank];
printf("Fahrzeug %d geladen!",idx);
}
}
return 1;
}
fInfo[idx][UmParken] = strval(output);
if(fInfo[idx][fModelID] >= 400 && fInfo[idx][fModelID] <= 611)
{
fInfo[idx][fCarid] = CreateVehicle(fInfo[idx][fModelID],fInfo[idx][f_X],fInfo[idx][f_Y],fInfo[idx][f_Z],fInfo[idx][f_R],fInfo[idx][fColor][0],fInfo[idx][fColor][1], -1);
Benzin[fInfo[idx][fCarid]] = fInfo[idx][Tank];
printf("Fahrzeug %d geladen!",idx);
}
}
return 1;
}