What's the problem with this code, it dosen't show the carid, always 0, car model always sential.
PHP код:
new vehicleee[24], vehicleidd = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pOwnedVehicle1] == 1)
{
new carkey1 = PlayerInfo[playerid][pOwnedVehicle1];
GetVehicleName(carkey1, vehicleee, sizeof(vehicleee));
format(string, sizeof(string), " CarID: %d | Model: %s (%d) | VehColor1: %d | VehColor2: %d ", vehicleidd, vehicleee, VehicleInfo[carkey1][vehModel], VehicleInfo[carkey1][vehC1], VehicleInfo[carkey1][vehC2]);
SendClientMessage(playerid, COLOR_GREY, string);
}
if(PlayerInfo[playerid][pOwnedVehicle2] == 1)
{
new carkey2 = PlayerInfo[playerid][pOwnedVehicle2];
GetVehicleName(carkey2, vehicleee, sizeof(vehicleee));
format(string, sizeof(string), " CarID: %d | Model: %s (%d) | VehColor1: %d | VehColor2: %d ", vehicleidd, vehicleee, VehicleInfo[carkey2][vehModel], VehicleInfo[carkey2][vehC1], VehicleInfo[carkey2][vehC2]);
SendClientMessage(playerid, COLOR_GREY, string);
}
if(PlayerInfo[playerid][pOwnedVehicle3] == 1)
{
new carkey3 = PlayerInfo[playerid][pOwnedVehicle3];
GetVehicleName(carkey3, vehicleee, sizeof(vehicleee));
format(string, sizeof(string), " CarID: %d | Model: %s (%d) | VehColor1: %d | VehColor2: %d ", vehicleidd, vehicleee, VehicleInfo[carkey3][vehModel], VehicleInfo[carkey3][vehC1], VehicleInfo[carkey3][vehC2]);
SendClientMessage(playerid, COLOR_GREY, string);
}
"vehicleidd" is assigned with the player's vehicle ID which in your case the player is not in any vehicle so
function returns 0.
carkey1, carkey2 and carkey3 hold the vehicleid so replace "vehicleidd" with those.