22/07/2024 06:10 
	
	
	
		Vamos adicionar mais mensagens de debug para entender melhor onde o processo está falhando. Adicionaremos mensagens para verificar se a função GerarV2 está sendo chamada corretamente e se há algum erro durante o carregamento dos dados.
Aqui está o código com mais mensagens de debug:
Por favor, reinicie o servidor com esse código atualizado e verifique o console novamente. O objetivo é verificar se a função GerarV2 está sendo chamada e se o ORM está retornando algum erro específico.
	
	
	
Aqui está o código com mais mensagens de debug:
Código PHP:
public OnGameModeInit() {
    for (new carror = 0; carror < MAX_CARROS; carror++) {
        CarregarCarros(carror);
    }
    return 1;
}
function CarregarCarros(vehid) {
    VehInfo[vehid][vORM] = orm_create("concessionaria", Conexao);
    VehInfo[vehid][VehID] = vehid;
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][CordX], "CordX");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][CordY], "CordY");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][CordZ], "CordZ");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][Angulo], "Angulo");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][rtX], "rtX");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][rtY], "rtY");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][rtZ], "rtZ");
    orm_addvar_float(VehInfo[vehid][vORM], VehInfo[vehid][Angulo1], "Angulo1");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Modelo], "Modelo");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][vCor1], "Cor1");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][vCor2], "Cor2");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][TDono], "TDono");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][TDono2], "TDono2");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Preco], "Preco");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Destrancado], "Destrancado");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Farol], "Farol");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Capo], "Capo");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Motor], "Motor");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Alarme], "Alarme");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Portas], "Portas");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][PMalas], "PMalas");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Litros], "Litros");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Problema], "Problema");
    orm_addvar_int(VehInfo[vehid][vORM], VehInfo[vehid][Contasveiculo], "Contasveiculo");
    orm_addvar_string(VehInfo[vehid][vORM], VehInfo[vehid][Dono], 24, "Dono");
    orm_addvar_string(VehInfo[vehid][vORM], VehInfo[vehid][Dono2], 24, "Dono2");
    orm_addvar_string(VehInfo[vehid][vORM], VehInfo[vehid][vNome], 24, "Nome");
    orm_addvar_string(VehInfo[vehid][vORM], VehInfo[vehid][Placa], 24, "Placa");
    orm_setkey(VehInfo[vehid][vORM], "VehID");
    orm_select(VehInfo[vehid][vORM], "GerarV2", "i", vehid);
    printf("Selecionando veículo ID %d\n", vehid);
    return 1;
}
function GerarV2(vehid) {
    printf("Chamando GerarV2 para veículo ID %d\n", vehid);
    if (orm_errno(VehInfo[vehid][vORM]) != ERROR_NO_DATA) {
        printf("Erro do ORM para veículo ID %d: %d\n", vehid, orm_errno(VehInfo[vehid][vORM]));
        if (VehInfo[vehid][Modelo] != 0) {
            new carroid;
            carroid = CreateVehicle(VehInfo[vehid][Modelo],
                                    VehInfo[vehid][CordX],
                                    VehInfo[vehid][CordY],
                                    VehInfo[vehid][CordZ],
                                    VehInfo[vehid][Angulo],
                                    VehInfo[vehid][vCor1],
                                    VehInfo[vehid][vCor2],
                                    false);
            SetVehicleNumberPlate(carroid, VehInfo[vehid][Placa]);
            VehInfo[vehid][Carro] = carroid;
            printf("Veículo ID %d criado com sucesso. Modelo: %d\n", vehid, VehInfo[vehid][Modelo]);
        }
    } else {
        printf("Nenhum dado encontrado para o veículo ID %d\n", vehid);
    }
} 
Por favor, reinicie o servidor com esse código atualizado e verifique o console novamente. O objetivo é verificar se a função GerarV2 está sendo chamada e se o ORM está retornando algum erro específico.

	   
	
