28.02.2015, 17:15
Creo que te has complicado la vida un poco. Si, como supongo, tu variable cInfo contiene los datos de los vehiculos, no es necesario que emplees las funciones GetVehicleByMatricula y GetOwnerByMatricula.
Me he permitido depurar y simplificar el codigo. Prueba de esta manera:
Me he permitido depurar y simplificar el codigo. Prueba de esta manera:
Код:
if(dialogid == DIALOG_ENCONTRAR_VEHICULO) { if(response && strlen(inputtext) > 0) { for(new i; i < sizeof(cInfo); i++) { if( cInfo[i][matricula] == inputtext && cInfo[i][id_x] != INVALID_VEHICLE_ID) { new string[160], Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME]; GetPlayerName(cInfo[i][ownerID], name, MAX_PLAYER_NAME); GetVehiclePos(cInfo[i][id_x], x, y, z); format(string, sizeof(string), "Panel de Localizacion: Vehiculo encontrado | Propietario: %s | Matricula: %s", name, inputtext); SendClientMessage(playerid, -1, string); SendClientMessage(playerid, COLOR_YELLOW, "Hemos enviado las coordenadas, dirigase al punto indicado."); printf("DEBUG OUTFOR: Encontrado - Pos: %f,%f,%f, %s", x, y, z, name); return 1; } } SendClientMessage(playerid, -1, "No se ha encontrado ningun vehiculo..."); } else SendClientMessage(playerid, -1, "Panel de localizacion cerrado."); return 1; }