їPor quй aparece en BlueBerry?
#1

Buenas, les explico un poco como funciona mi comando... cuando compras un vehнculo con el comando indiciado al vehнculo que se va a crear se le asigna lo siguiente
Код:
InformacionVehiculo_[TotalVehiculos][vParking][0] = InformacionVehiculo_[VehiculoID][vSpawn][0];
InformacionVehiculo_[TotalVehiculos][vParking][1] = InformacionVehiculo_[VehiculoID][vSpawn][1];
InformacionVehiculo_[TotalVehiculos][vParking][2] = InformacionVehiculo_[VehiculoID][vSpawn][2];
InformacionVehiculo_[TotalVehiculos][vPAngle] = InformacionVehiculo_[VehiculoID][vSAngle];
una vez asignado esto a las variables de Parking que se les asigna bien cuando se crea el vehнculo deberнa de aparecer en la posiciуn que se le asigna ahн junto con el jugador pero en vez de eso aparece en BlueBerry en coordenadas -1 -1 -1, por quй pasa esto?

asн es mi comando, el error estarб en CrearVehiculo = CreateVehicle para abajo... ya que todo funciona bien menos cuando se le asigna el vehнculo al jugador que aparecen en BlueBerry.

Код:
CMD:comprar(playerid, params[])
{
	if(strfind(params[0], "vehiculo", true) != -1)
	{
        if(IsPlayerInAnyVehicle(playerid))
        {
            new EspacioLibre, VehiculoID = GetPlayerVehicleID(playerid);
	        if(InformacionVehiculo_[VehiculoID][vEstado] == 0) return SendErrorMessage(playerid, "Este vehнculo no estб a la venta.");
            if(GetPlayerCash(playerid) < InformacionVehiculo_[playerid][vPrecio]) return SendErrorMessage(playerid, "No tienes el dinero necesario para comprar este vehнculo.");
            if(InformacionJugador_[playerid][pPremium] == 0)
            {
				for(new l = 0; l < 4; l ++)
				{
				    if(InformacionJugador_[playerid][pLlavesCoches][l] == 0){EspacioLibre = 1; break;}
				}
				if(EspacioLibre == 0){SendErrorMessage(playerid, "Ya tienes todas las llaves ocupadas siendo usuario Normal."); return 1;}
            }
            if(InformacionJugador_[playerid][pPremium] == 1)
            {
				for(new l = 0; l < 8; l ++)
				{
				    if(InformacionJugador_[playerid][pLlavesCoches][l] == 0){EspacioLibre = 1; break;}
				}
				if(EspacioLibre == 0){SendErrorMessage(playerid, "Ya tienes todas las llaves ocupadas siendo usuario Premium."); return 1;}
            }
            ++TotalVehiculos;
			InformacionVehiculo_[TotalVehiculos][vModelo] = InformacionVehiculo_[VehiculoID][vModelo];
			InformacionVehiculo_[TotalVehiculos][vColor][0] = 1;
			InformacionVehiculo_[TotalVehiculos][vColor][1] = 1;
			InformacionVehiculo_[TotalVehiculos][vMotor] = 0;
			InformacionVehiculo_[TotalVehiculos][vPrecio] = InformacionVehiculo_[VehiculoID][vPrecio];
			InformacionVehiculo_[TotalVehiculos][vInterior] = GetPlayerInterior(playerid);
			InformacionVehiculo_[TotalVehiculos][vVirtualWorld] = GetPlayerVirtualWorld(playerid);
			InformacionVehiculo_[TotalVehiculos][vParking][0] = InformacionVehiculo_[VehiculoID][vSpawn][0];
			InformacionVehiculo_[TotalVehiculos][vParking][1] = InformacionVehiculo_[VehiculoID][vSpawn][1];
			InformacionVehiculo_[TotalVehiculos][vParking][2] = InformacionVehiculo_[VehiculoID][vSpawn][2];
			InformacionVehiculo_[TotalVehiculos][vPAngle] = InformacionVehiculo_[VehiculoID][vSAngle];
			InformacionVehiculo_[TotalVehiculos][vSpawn][0] = -1;
			InformacionVehiculo_[TotalVehiculos][vSpawn][1] = -1;
			InformacionVehiculo_[TotalVehiculos][vSpawn][2] = -1;
			InformacionVehiculo_[TotalVehiculos][vSAngle] = -1;
			InformacionVehiculo_[TotalVehiculos][vEstado] = 0;
			InformacionVehiculo_[TotalVehiculos][vKilometros] = 0;
			InformacionVehiculo_[TotalVehiculos][vTipo] = InformacionVehiculo_[VehiculoID][vTipo];
			InformacionVehiculo_[TotalVehiculos][vCantidad] = -1;
			InformacionVehiculo_[TotalVehiculos][vSQLID] = TotalVehiculos;
		    for(new l; l < 8; l ++)
			{
				if(InformacionJugador_[playerid][pLlavesCoches][l] == 0)
				{
					InformacionJugador_[playerid][pLlavesCoches][l] = InformacionVehiculo_[TotalVehiculos][vSQLID];
					break;
				}
			}
			new random1 = random(99), random2 = random(99), matricula[10];
			format(matricula, sizeof(matricula), "EV %d%d", random1, random2);
            format(InformacionVehiculo_[TotalVehiculos][vPropietario], 25, "%s", GetPlayerNameEx(playerid));
            format(InformacionVehiculo_[TotalVehiculos][vMatricula], 10, "%s", matricula);
			new Query[200];
			mysql_format(MySQL, Query, sizeof Query, "INSERT INTO vehiculos (vSQLID, vPosX, vPosY, vPosZ, vMatricula, vPropietario) VALUES ('%d', '%f', '%f', '%f', '%e', '%e')", InformacionVehiculo_[TotalVehiculos][vSQLID], InformacionVehiculo_[TotalVehiculos][vParking][0],
			InformacionVehiculo_[TotalVehiculos][vParking][1], InformacionVehiculo_[TotalVehiculos][vParking][2], InformacionVehiculo_[TotalVehiculos][vMatricula], InformacionVehiculo_[TotalVehiculos][vMatricula]);
			mysql_tquery(MySQL, Query);
			new CrearVehiculo;
			CrearVehiculo = CreateVehicle(InformacionVehiculo_[TotalVehiculos][vModelo], InformacionVehiculo_[TotalVehiculos][vSpawn][0], InformacionVehiculo_[TotalVehiculos][vSpawn][1], InformacionVehiculo_[TotalVehiculos][vSpawn][2], InformacionVehiculo_[TotalVehiculos][vSAngle],
			InformacionVehiculo_[TotalVehiculos][vColor][0], InformacionVehiculo_[TotalVehiculos][vColor][1], 600000);
            LinkVehicleToInterior(CrearVehiculo, InformacionVehiculo_[TotalVehiculos][vInterior]), SetVehicleVirtualWorld(CrearVehiculo, InformacionVehiculo_[TotalVehiculos][vVirtualWorld]);
	        SetVehicleNumberPlate(CrearVehiculo, InformacionVehiculo_[TotalVehiculos][vMatricula]);
			GetVehicleParamsEx(CrearVehiculo, engine, lights, alarm, doors, bonnet, boot, objective);
			SetVehicleParamsEx(CrearVehiculo, 0, 0, alarm, doors, bonnet, boot, objective), SetVehicleHealthEx(CrearVehiculo, 1000);
			PutPlayerInVehicle(playerid, CrearVehiculo, 0), QuitarDineroPlayer_(playerid, InformacionVehiculo_[TotalVehiculos][vPrecio]);
			new string[100];
			SendClientMessage(playerid, COLOR_BLANCO, "-------------------------------------------------------------------------------------------------------------------");
            SendClientMessage(playerid, COLOR_GRIS_2, "* ЎFelicidades!"#CBLANCO" compraste un vehнculo, para obtener mбs informaciуn usa el comando "#CAMARILLO"/ayuda.");
			if(InformacionVehiculo_[TotalVehiculos][vTipo] == 0)
			{
				format(string, sizeof(string), "* El vehнculo tiene la patente "#CAZUL"%s"#CBLANCO" y tiene un encendido "#CROJO_2"*Malo*.", InformacionVehiculo_[TotalVehiculos][vMatricula]);
				SendClientMessage(playerid, COLOR_BLANCO, string);
            }
			if(InformacionVehiculo_[TotalVehiculos][vTipo] == 1)
			{
				format(string, sizeof(string), "* El vehнculo tiene la patente "#CAZUL"%s"#CBLANCO" y tiene un encendido "#CVERDE_CLARO"Excelente.", InformacionVehiculo_[TotalVehiculos][vMatricula]);
				SendClientMessage(playerid, COLOR_BLANCO, string);
            }
            SendClientMessage(playerid, COLOR_BLANCO, "* El vehнculo viene por defecto con una "#CCELESTE"Baterнa Cyclon 6V"#CBLANCO" de calidad "#CROJO"*Baja*.");
			SendClientMessage(playerid, COLOR_ROJO_2, "* Importante: ЎNo dejes tu vehнculo mal estacionado o podrб ser llevado al deposito!");
			SendClientMessage(playerid, COLOR_BLANCO, "-------------------------------------------------------------------------------------------------------------------");
            ActualizarVehiculo(TotalVehiculos), ActualizarJugador(playerid);
	    }
    }
	return 1;
}
Reply
#2

Estбs asignando las variables que dices a -1;

Код:
InformacionVehiculo_[TotalVehiculos][vSpawn][0] = -1;
InformacionVehiculo_[TotalVehiculos][vSpawn][1] = -1;
InformacionVehiculo_[TotalVehiculos][vSpawn][2] = -1;
Cбmbialo por:

Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
InformacionVehiculo_[TotalVehiculos][vSpawn][0] = x;
InformacionVehiculo_[TotalVehiculos][vSpawn][1] = y + 2.0;
InformacionVehiculo_[TotalVehiculos][vSpawn][2] = z;
El vehнculo tendrнa que aparecer al lado del jugador.
Reply
#3

Quote:
Originally Posted by LatinZ
Посмотреть сообщение
Estбs asignando las variables que dices a -1;

Код:
InformacionVehiculo_[TotalVehiculos][vSpawn][0] = -1;
InformacionVehiculo_[TotalVehiculos][vSpawn][1] = -1;
InformacionVehiculo_[TotalVehiculos][vSpawn][2] = -1;
Cбmbialo por:

Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
InformacionVehiculo_[TotalVehiculos][vSpawn][0] = x;
InformacionVehiculo_[TotalVehiculos][vSpawn][1] = y + 2.0;
InformacionVehiculo_[TotalVehiculos][vSpawn][2] = z;
El vehнculo tendrнa que aparecer al lado del jugador.
No, yo las asigno a -1 cuando el jugador compra el vehнculo ya que Spawn no se usa mбs una vez compres el vehнculo, te explico, vSpawn cuando creo un auto en venta voy a la posiciуn que quiera que haga spawn el vehнculo al momento de comprarlo y le doy click, ahн se guarda la posiciуn entonces cuando compras un vehнculo la posiciуn de vSpawn se le asigna a vParking y el vehнculo debe de aparecer ahн pero no lo hace, aparece en BlueBerry cuando aplicу las coordenadas correctas, ya vSpawn no se usa mбs porque es un vehнculo de usuario y no en venta por eso las pongo en -1.
Reply
#4

Ya funciona, me hiciste darme de cuenta del error LatinZ, estaba dбndole spawn al vehнculo con vSpawn en vez de vParking.... se me olvidу cambiar eso a ъltimo momento porque habнa cambiado todo el sistema de spawn, gracias, +REP...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)