hallo liebe com,
ich finde einfach den fehler nicht... die Autos laden nicht. Könnt ihr mir villt helfen??
getFreeCarID()
{
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x]==0)return i;
}
return 0;
}
forward onPlayerCarLoad(playerid);
public onPlayerCarLoad(playerid)
{
new num_fields, num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return print("keine autos");
for(new i=0; i<num_rows; i++)
{
new c_id = getFreeCarID();
cInfo[c_id][c_model]=cache_get_field_content_int(i,"model",dbhandle);
cInfo[c_id][besitzer]=cache_get_field_content_int(i,"besitzer",dbhandle);
cInfo[c_id][c_x]=cache_get_field_content_float(i,"x",dbhandle);
cInfo[c_id][c_y]=cache_get_field_content_float(i,"y",dbhandle);
cInfo[c_id][c_z]=cache_get_field_content_float(i,"z",dbhandle);
cInfo[c_id][c_r]=cache_get_field_content_float(i,"r",dbhandle);
cInfo[c_id][db_id]=cache_get_field_content_int(i,"id",dbhandle);
cInfo[c_id][id_x]=CreateVehicle(cInfo[c_id][c_model],cInfo[c_id][c_x],cInfo[c_id][c_y],cInfo[c_id][c_z],cInfo[c_id][c_r],-1,-1,0);
}
return 1;
}
loadPlayerCars(playerid)
{
new query[164];
format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%i'",sInfo[playerid][id]);
mysql_function_query(dbhandle,query,true,"onPlayerCarLoad","i",playerid);
return 1;
}