Hey,
Kann mir jemand sagen, wie ich die Funktion machen muss dass wenn sich ein Spieler einloggt die Fahrzeuge verschlossen sind und nicht offen?
public OnPlayerCarsLoad(playerid)
{
new query[128], data[356];
new engine,lights,alarm,doors,bonnet,boot,objective;
format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%i'",PlayerInfo[playerid][pMySQLID]);
mysql_query(query);
printf("query = %s", query);
mysql_store_result();
new num_rows = mysql_num_rows();
printf("%i num rows",num_rows);
if(num_rows > 0)
{
while(mysql_fetch_row(data))
{
new i=getFreeCarID();
mysql_fetch_field("model",data); cInfo[i][carmodel] = strval(data);
mysql_fetch_field("besitzer",data); cInfo[i][besitzer] = strval(data);
mysql_fetch_field("Farbe1",data); cInfo[i][color_1] = strval(data);
mysql_fetch_field("Farbe2",data); cInfo[i][color_2] = strval(data);
mysql_fetch_field("x",data); cInfo[i][c_x] = floatstr(data);
mysql_fetch_field("y",data); cInfo[i][c_y] = floatstr(data);
mysql_fetch_field("z",data); cInfo[i][c_z] = floatstr(data);
mysql_fetch_field("r",data); cInfo[i][c_r] = floatstr(data);
mysql_fetch_field("id",data); cInfo[i][db_id] = strval(data);
mysql_fetch_field("Kennzeichen",data); format(cInfo[i][kennzeichen], 64, data);
printf("Kennzeichen (%d) = %s", i, cInfo[i][kennzeichen]);
mysql_fetch_field("slot",data); cInfo[i][slot_id] = strval(data);
cInfo[i][id_x] = CreateVehicle(cInfo[i][carmodel],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][color_1],cInfo[i][color_2],-1);
SetVehicleNumberPlate(cInfo[i][id_x],cInfo[i][kennzeichen]);
GetVehicleParamsEx(cInfo[i][id_x],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(cInfo[i][id_x],engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
}
}
mysql_free_result();
return 1;
}