Guten Tag,
ich nutze das Plugin MySQL R39-2, und irgentwie laden die Fraktionscars nicht.
Hier meine Codes:
public LoadFrakCars2()
{
mysql_function_query(dbhandle, "SELECT * FROM frakcars", true,"LoadFrakCars", "");
return 1;
}
public LoadFrakCars()
{
for(new i=0; i<sizeof(fCar); i++)
{
fCar[i][fdb_id] = cache_get_field_content_int(0, "id");
fCar[i][fModel] = cache_get_field_content_int(0, "Model");
fCar[i][fx] = cache_get_field_content_float(0, "X");
fCar[i][fy] = cache_get_field_content_float(0, "Y");
fCar[i][fz] = cache_get_field_content_float(0, "Z");
fCar[i][fr] = cache_get_field_content_float(0, "R");
fCar[i][fc1] = cache_get_field_content_int(0, "Farbe1");
fCar[i][fc2] = cache_get_field_content_int(0, "Farbe2");
fCar[i][f_ID] = cache_get_field_content_int(0, "fID");
fCar[i][fvID] = CreateVehicle(fCar[i][fModel], fCar[i][fx], fCar[i][fy], fCar[i][fz], fCar[i][fr], fCar[i][fc1], fCar[i][fc2], 0);
}
return 1;
}
public FrakCarCreated()
{
for(new i=0; i<sizeof(fCar); i++)
{
fCar[i][fdb_id] = cache_insert_id(dbhandle);
}
return 1;
}
OnGameModeInit:
LoadFrakCars2();
Mein Befehl:
ocmd:createfcar(playerid, params[])
{
new fID, vehID, c1, c2, query[512];
new Float:Pos[4];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
if(sscanf(params,"iiii",fID, vehID, c1, c2))return scm(playerid, COLOR_WHITE, "Nutzung: /createfcar [Fraktions-ID] [Fahrzeug-ID] [Farbe1] [Farbe2]");
format(query, sizeof(query), "INSERT INTO frakcars(Model,X,Y,Z,R,Farbe1,Farbe2,fID) VALUES ('%i','%f','%f','%f','%f','%i','%i','%i')", vehID, Pos[0], Pos[1], Pos[2], Pos[3], c1, c2, fID);
mysql_function_query(dbhandle, query, true, "FrakCarCreated", "");
new car = CreateVehicle(vehID, Pos[0], Pos[1], Pos[2], Pos[3], c1, c2, 0);
PutPlayerInVehicle(playerid, car, 0);
return 1;
}
Sorry für so wenig Text bin seit 03:00 UHR wach.
Lg,
Skoam