17.11.2012, 21:00
hey everyone,
as some of you know im working on a BTTF car, but now when i change the world of the car, to the past world, the car and me stay in it and the speed stays same, but the objects i have attached to it, arent on it anymore, theyre gone... and when i go back to the future, then it does works, but how can i fix this?
thats onplayerupdate
how can i change the attached objects to the vehicle again at the right world at the right time?, so it will look like they have never been gone
as some of you know im working on a BTTF car, but now when i change the world of the car, to the past world, the car and me stay in it and the speed stays same, but the objects i have attached to it, arent on it anymore, theyre gone... and when i go back to the future, then it does works, but how can i fix this?
pawn Код:
if(GetPlayerSpeed(playerid) >= 140 && GetPlayerVehicleID(playerid) == Delorean && PlayerInfo[playerid][HasPlutonium] == 2)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(Delorean, x, y, z);
PlayerInfo[playerid][HasPlutonium] = 0;
SetWorld(playerid, "PastWorld");
SetVehicleVirtualWorld(Delorean, 1000);
SetVehiclePos(Delorean,-1052.7469,-1634.5173,76.0235);
SetVehicleZAngle(Delorean,94.0786);
PutPlayerInVehicle(playerid, Delorean, 0);
SetVehicleVelocity(Delorean, x-60, y-60, z-60);
GameTextForPlayer(playerid, "you have been transfered to the year ~r~1955", 3000, 5);
SendClientMessage(playerid, COLOR_WHITE, "NOTE: you have 1 plutonium bar left, use it to go back, or you will be stuck in the past ForEver!");
SendClientMessage(playerid, COLOR_WHITE, "NOTE: if you loose the Delorean, you are also stuck in the past Forever!");
SendClientMessage(playerid, COLOR_WHITE, "NOTE: it takes 60 seconds to reload the Plutonium in to the Delorean");
SetTimer("EnableDelorean", 60000, 0);
}
if(GetPlayerSpeed(playerid) >= 140 && GetPlayerVehicleID(playerid) == Delorean && PlayerInfo[playerid][HasPlutonium] == 1)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(Delorean, x, y, z);
SetWorld(playerid, "DriftWorld");
SetVehicleVirtualWorld(Delorean, 1);
SetPlayerWeather(playerid, 0);
PlayerInfo[playerid][HasPlutonium] = 0;
GameTextForPlayer(playerid, "you have been transfered back to the year ~r~2012", 3000, 5);
SendClientMessage(playerid, COLOR_WHITE, "you have 0 Plutonium bars left");
SetVehicleVelocity(Delorean, x, y, z);
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER && GetPlayerVehicleID(playerid) == Delorean) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, COLOR_RED, "only the driver may use this vehicle, no passengers allowed");
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == Delorean)
{
if(PlayerInfo[playerid][HasPlutonium] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "as soon as this Delorean hits 88 mph/140 kmh it will send you to the past");
}
else if(PlayerInfo[playerid][HasPlutonium] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "you cannot use this vehicle without Plutonium");
}
}
}
if(oldstate == PLAYER_STATE_DRIVER)
{
//
}
return 1;
}