Car to Airplane
#1

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 ?
Reply
#2

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.
Reply
#3

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 ??
Reply
#4

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.
Reply
#5

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]);
Reply
#6

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
Reply
#7

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 ?)
Reply
#8

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.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)