Sera un bucle mald1to?
#5

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:
Код:
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;
}
Reply


Messages In This Thread
(Resuelto) Bucle Bendito - by N3cromancer - 28.02.2015, 09:35
Respuesta: Sera un bucle mald1to? - by alexus - 28.02.2015, 11:39
Re: Sera un bucle mald1to? - by N3cromancer - 28.02.2015, 11:50
Re: Sera un bucle mald1to? - by N3cromancer - 28.02.2015, 12:23
Respuesta: Sera un bucle mald1to? - by alexus - 28.02.2015, 17:15
Re: Sera un bucle mald1to? - by N3cromancer - 28.02.2015, 20:21

Forum Jump:


Users browsing this thread: 1 Guest(s)