15.11.2017, 14:04
(
Последний раз редактировалось Lucases; 15.11.2017 в 15:21.
)
Vehicle Plate isn't loading, it's weird, because the owner's name loads without problems.
This is the server log
Everything loadfs fine except the plate "PLate Loaded: " is empty.
PHP код:
forward LoadPlayerVehicles(playerid);
public LoadPlayerVehicles(playerid)
{
new query[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(query, sizeof(query), "SELECT * FROM vehicles WHERE Owner = '%s'", pname);
new DBResult:data = db_query(vehiclesdb, query), count;
if(db_num_rows(data) > 0)
{
for(new a; a<db_num_rows(data); a++)
{
new vehicleid = GetFreeVehicleSlot();
IsValidVehicle[vehicleid] = true;
VehicleInfo[vehicleid][vID] = db_get_field_assoc_int(data, "ID");
//printf("Vehicle ID: %i", VehicleInfo[vehicleid][vID]);
VehicleInfo[vehicleid][vModelid] = db_get_field_assoc_int(data, "Model");
//printf("Vehicle Model: %i", VehicleInfo[vehicleid][vModelid]);
VehicleInfo[vehicleid][vType] = VEHICLE_PLAYER;
//printf("Vehicle Type: %i", VehicleInfo[vehicleid][vType]);
db_get_field_assoc(data, "Owner", VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME);
//printf("Vehicle Owner %s", VehicleInfo[vehicleid][vOwner]);
VehicleInfo[vehicleid][vPrice] = db_get_field_assoc_int(data, "Price");
//printf("Vehicle Price: %i", VehicleInfo[vehicleid][vPrice]);
VehicleInfo[vehicleid][vX] = db_get_field_assoc_float(data, "X");
//printf("Vehicle X: %f", VehicleInfo[vehicleid][vX]);
VehicleInfo[vehicleid][vY] = db_get_field_assoc_float(data, "Y");
//printf("Vehicle Y: %f", VehicleInfo[vehicleid][vY]);
VehicleInfo[vehicleid][vZ] = db_get_field_assoc_float(data, "Z");
//printf("Vehicle Z: %f", VehicleInfo[vehicleid][vZ]);
VehicleInfo[vehicleid][vA] = db_get_field_assoc_float(data, "A");
//printf("Vehicle A: %f", VehicleInfo[vehicleid][vA]);
VehicleInfo[vehicleid][vColor1] = db_get_field_assoc_int(data, "COLOR1");
//printf("Vehicle Primary Color: %i", VehicleInfo[vehicleid][vColor1]);
VehicleInfo[vehicleid][vColor2] = db_get_field_assoc_int(data, "COLOR2");
//printf("Vehicle Secondary Color: %i", VehicleInfo[vehicleid][vColor2]);
db_get_field_assoc(data, "Plate", VehicleInfo[vehicleid][vPlate], 9);
//printf("Plate Loaded: %s", VehicleInfo[vehicleid][vPlate]);
CreateVehicle(VehicleInfo[vehicleid][vModelid], VehicleInfo[vehicleid][vX],VehicleInfo[vehicleid][vY], VehicleInfo[vehicleid][vZ], VehicleInfo[vehicleid][vA], VehicleInfo[vehicleid][vColor1],VehicleInfo[vehicleid][vColor1], -1);
SetTimerEx("SetPlayerVehiclePlate", 200, false, "i", vehicleid);
count++;
db_next_row(data);
}
printf("%i vehicle(s) loaded for player %s", count, pname);
}
}

Everything loadfs fine except the plate "PLate Loaded: " is empty.