Car to Airplane -
LionCodeT4 - 28.04.2013
How can i make when the player is on the car and pressing some key the Car become a Airplane with out to stop the speed ?
AW: Car to Airplane -
BigETI - 28.04.2013
Get the velocity, position, and rotation of the player's car, destroy it, spawn a plane at the coordinates and rotation you have destroyed your car, put player inside the plane, and set its velocity you have got earlier from your destroyed car.
Re: AW: Car to Airplane -
LionCodeT4 - 28.04.2013
Quote:
Originally Posted by BigETI
Get the velocity, position, and rotation of the player's car, destroy it, spawn a plane at the coordinates and rotation you have destroyed your car, put player inside the plane, and set its velocity you have got earlier from your destroyed car.
|
Код:
if(newkeys & KEY_YES)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:Speed[3],Float:Pos[4],id;
id = GetPlayerVehicleID(playerid);
GetVehicleVelocity(id,Speed[0],Speed[1],Speed[2]);
GetVehiclePos(id,Pos[0],Pos[1],Pos[2]);
GetVehicleZAngle(id,Pos[3]);
SetVehiclePos(id,Pos[0]+(40*floatcos(90+Pos[3],degrees)),Pos[1]+(40*floatsin(90+Pos[3],degrees)),Pos[2]);
SetVehicleZAngle(id,Pos[3]);
SetVehicleVelocity(id,Speed[0],Speed[1],Speed[2]);
PlayerPlaySound(playerid, 6003, 0.0, 0.0, 0.0);
CreateVehicle(520, Float:x , Float:y , Float:z + 1,90.0,-1, -1, -1);
i dident create this script i just put createVehicle ??
Re: Car to Airplane -
Tamer - 28.04.2013
You can make functions that would set the player's X-Y-Z coordinates every miliseconds or use KeyStateChange to move it,it would heavily use OnPlayerUpdate(depends how brutal you script) Also the player should be frozen while it is done. The idea is nice.
AW: Car to Airplane -
BigETI - 28.04.2013
Create the plane
before you set its position, rotation, and velocity.
Edit:
If you spawn a "Hydra" ID 520, it will kill the set velocity, because it always spawn in hover mode.
Anyway
pawn Код:
new my_vehicle = GetPlayerVehicleID(playerid), Float:v_dat[7];
GetVehiclePos(my_vehicle, v_dat[0], v_dat[1], v_dat[2]);
GetVehicleZAngle(my_vehicle, v_dat[3]);
GetVehicleVelocity(my_vehicle, v_dat[4], v_dat[5], v_dat[6]);
DestroyVehicle(my_vehicle);
PutPlayerInVehicle(playerid, my_vehicle = CreateVehicle(519, v_dat[0], v_dat[1], v_dat[2], v_dat[3], 1, 1, 0), 0);
SetVehicleVelocity(my_vehicle, v_dat[4], v_dat[5], v_dat[6]);
Re: Car to Airplane -
LionCodeT4 - 28.04.2013
Quote:
Originally Posted by Tamer T
You can make functions that would set the player's X-Y-Z coordinates every miliseconds or use KeyStateChange to move it,it would heavily use OnPlayerUpdate(depends how brutal you script) Also the player should be frozen while it is done. The idea is nice.
|
Im not so know how to make all of this,if you can create this it will be very very helpful and fucking osm and tnx for you like it
Re: AW: Car to Airplane -
LionCodeT4 - 28.04.2013
Quote:
Originally Posted by BigETI
Create the plane before you set its position, rotation, and velocity.
Edit:
If you spawn a "Hydra" ID 520, it will kill the set velocity, because it always spawn in hover mode.
Anyway
pawn Код:
new my_vehicle = GetPlayerVehicleID(playerid), Float:v_dat[7]; GetVehiclePos(my_vehicle, v_dat[0], v_dat[1], v_dat[2]); GetVehicleZAngle(my_vehicle, v_dat[3]); GetVehicleVelocity(my_vehicle, v_dat[4], v_dat[5], v_dat[6]); DestroyVehicle(my_vehicle); SetVehicleVelocity(CreateVehicle(519, v_dat[0], v_dat[1], v_dat[2], v_dat[3], 1, 1, 0), v_dat[4], v_dat[5], v_dat[6]);
|
Cool man tnx
but when you said "kill the set velocity" you mean i cant to create the plane when the car on move?
(how can i edit when is in the car and spwn the plen he spwn inside of it ?)
Re: AW: Car to Airplane -
Basssiiie - 28.04.2013
Quote:
Originally Posted by LionCodeT4
Cool man tnx but when you said "kill the set velocity" you mean i cant to create the plane when the car on move?
|
When a Hydra spawns, it goes into hover ("helicopter") mode (instead of "plane" mode), which will slow down the plane.
Re: AW: Car to Airplane -
LionCodeT4 - 28.04.2013
Quote:
Originally Posted by Basssiiie
When a Hydra spawns, it goes into hover ("helicopter") mode (instead of "plane" mode), which will slow down the plane.
|
Ok but Does not matter i get the boost mod