Hola buenas, tenнa una duda y es porquй cuando cojo el бngulo del vehнculo y todo, luego cuando respawnea spawnea con otro бngulo, es rarнsimo...
pawn Код:
//Coger posiciуn
new Float:Pos[4];
GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[4]);
// Luego los Pos[0-4] los almaceno en la variable AutoInfo[id][ax], AutoInfo[id][ay]....
//En OnVehicleSpawn
SetVehiclePos(id, AutoInfo[id][ax], AutoInfo[id][ay], AutoInfo[id][az]);
SetVehicleZAngle(id, AutoInfo[id][aa]);
Puedes mostrarnos algo mas de codigo, con los codigos que dejaste solo podemos adivinar que pasa con esas variables en el medio.
pawn Код:
// Cуdigo del guardado de posiciуn
stock ApagarVehiculo(vehicleid, playerid)
{
new string[128];
if(AutoInfo[vehicleid][aMotor])
{
new engine, lights, alarm, doors, bonnet, boot, objective;
AutoInfo[vehicleid][aMotor] = 0;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s apagу el motor del %s.", NombreJugador(playerid), AutoInfo[vehicleid][aDescripcion]);
ProxDetector(15.0, playerid, string, ROSA, ROSA, ROSA, ROSA, ROSA);
if(AutoInfo[vehicleid][aFaccionID] == 8888)
{
new Float:Pos[4];
GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(vehicleid, Pos[3]);
AutoInfo[vehicleid][ax] = Pos[0]; AutoInfo[vehicleid][ay] = Pos[1]; AutoInfo[vehicleid][az] = Pos[2]; AutoInfo[vehicleid][aa] = Pos[3];
UpdateVehFloat(AutoInfo[vehicleid][aID], "X", Pos[0]); UpdateVehFloat(AutoInfo[vehicleid][aID], "Y", Pos[1]); UpdateVehFloat(AutoInfo[vehicleid][aID], "Z", Pos[2]); UpdateVehFloat(AutoInfo[vehicleid][aID], "Angle", Pos[3]);
}
ActualizarVeh(vehicleid);
}
return 1;
}
// Cуdigo del OnVehicleSpawn
public OnVehicleSpawn(vehicleid)
{
AutoInfo[vehicleid][aMotor] = 0;
if(VehExploto[vehicleid] == 1)
{
SetVehicleHealthEx(vehicleid, 350.0);
AutoInfo[vehicleid][aRoto] = 1;
UpdateVehicleDamageStatus(vehicleid, 3565161, 33554946, 4, 0);
}
SetVehiclePos(vehicleid, AutoInfo[vehicleid][ax], AutoInfo[vehicleid][ay], AutoInfo[vehicleid][az]);
SetVehicleZAngle(vehicleid, AutoInfo[vehicleid][aa]);
LinkVehicleToInterior(vehicleid, AutoInfo[vehicleid][aInteriorID]);
new motor, luces, alarma, puertas, capo, maletero, objetivo;
GetVehicleParamsEx(vehicleid, motor, luces, alarma, puertas, capo, maletero, objetivo);
SetVehicleParamsEx(vehicleid, 0, 0, alarma, puertas, 0, 0, objetivo);
return 1;
}