Hey ich habe immer folgende meldung zu datenbank was die autosbetrifft;
[14:32:17] [WARNING] CMySQLConnection::Disconnect - no connection available
Deswegen werde auch keine autos geladen,,,,
Woran könnte das liegen?
Das passiert wenn der spieler sich einloggt
forward loadPlayerCars(playerid);
public loadPlayerCars(playerid)
{
new query[128];
format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%i'",PlayerInfo[playerid][dbid]);
mysql_pquery(dbhandle,query,"OnPlayerCarsLoad","i",playerid);
return 1;
}
Die funktionen
forward OnPlayerCarsLoad(playerid);
public OnPlayerCarsLoad(playerid)
{
if(!cache_num_rows())return 1;
for(new c=0;c<cache_num_rows();c++)
{
new i= getFreeCarID();
cInfo[i][db_id] = cache_get_field_content_int(c,"id");
cInfo[i][besitzer] = cache_get_field_content_int(c,"besitzer");
cInfo[i][model] = cache_get_field_content_int(c,"model");
cInfo[i][c_x] = cache_get_field_content_float(c,"x");
cInfo[i][c_y] = cache_get_field_content_float(c,"y");
cInfo[i][c_z] = cache_get_field_content_float(c,"z");
cInfo[i][c_r] = cache_get_field_content_float(c,"r");
cInfo[i][ci_tank] = cache_get_field_content_float(c,"tank");
cInfo[i][Farbe1] = cache_get_field_content_int(c,"color1");
cInfo[i][Farbe2] = cache_get_field_content_int(c,"color2");
cInfo[i][Paintjob] = cache_get_field_content_int(c,"paintjob");
cInfo[i][Tuning][0] = cache_get_field_content_int(c,"spoiler");
cInfo[i][Tuning][1] = cache_get_field_content_int(c,"hood");
cInfo[i][Tuning][2] = cache_get_field_content_int(c,"roof");
cInfo[i][Tuning][3] = cache_get_field_content_int(c,"sideskirt");
cInfo[i][Tuning][4] = cache_get_field_content_int(c,"lamps");
cInfo[i][Tuning][5] = cache_get_field_content_int(c,"nitro");
cInfo[i][Tuning][6] = cache_get_field_content_int(c,"exhaust");
cInfo[i][Tuning][7] = cache_get_field_content_int(c,"wheels");
cInfo[i][Tuning][8] = cache_get_field_content_int(c,"stereo");
cInfo[i][Tuning][9] = cache_get_field_content_int(c,"hydraulics");
cInfo[i][Tuning][10] = cache_get_field_content_int(c,"frontbumper");
cInfo[i][Tuning][11] = cache_get_field_content_int(c,"rearbumper");
cInfo[i][Tuning][12] = cache_get_field_content_int(c,"ventright");
cInfo[i][Tuning][13] = cache_get_field_content_int(c,"ventleft");
cInfo[i][id_x] = CreateVehicle(cInfo[i][model],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][Farbe1],cInfo[i][Farbe2],-1);
Iter_Add(SpielerCars[playerid],i);
Tank[cInfo[i][id_x]]=cInfo[i][ci_tank];
TankZeit[cInfo[i][id_x]]=-1;
AddSCarTuning(i);
}
return 1;
}