Car flipping at certain angles.
#1

Basically, here's what I want to do. If a player's vehicle is at LESS than 250 degrees or greater than 130 degrees on the Y coordinate, the car flips. Here's my script.

pawn Код:
if (newkeys & KEY_SUBMISSION) // && !(oldkeys & KEY_SUBMISSION)
        {
                new VEHID, Float:W, Float:X, Float:Y, Float:Z;
                VEHID = GetPlayerVehicleID(playerid);
                GetVehicleRotationQuat(VEHID, W,X,Y,Z);
                if(Y >= 130 || Y <= 250)
                {
                    RepairVehicle(VEHID);
                    RemoveVehicleComponent(VEHID,1010);
                    AddVehicleComponent(VEHID,1010);
                    GetVehicleZAngle(VEHID, Z);
                    SetVehicleZAngle(VEHID, Z+0.1);
                }
                else
                {
                    RepairVehicle(VEHID);
                    RemoveVehicleComponent(VEHID,1010);
                    AddVehicleComponent(VEHID,1010);
                }
                return 1;
        }
Any help would be HIGHLY appreciated. Thanks!
Reply
#2

GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);

i think this will work
Coz i saw this on moneypimp's satdm
Reply
#3

GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);

i think this will work
Coz i saw this on moneypimp's satdm
Reply
#4

Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);

i think this will work
Coz i saw this on moneypimp's satdm
How on EARTH would this work? If I'm correct, I believe the GetVehiclePos gets the vehicles coordinates on the map. Therefore, when setting it to what it currently is, this technically, in theory, would do nothing. And I'm not necessarily trying to flip the car on command, I'm trying to track the Y angle of the car, and when it is in the 130-250 range, the car re-flips. I already know how to flip a car. It's just this bit that's confusing me.
Reply
#5

Quote:
Originally Posted by TyThaBomb
Посмотреть сообщение
How on EARTH would this work? If I'm correct, I believe the GetVehiclePos gets the vehicles coordinates on the map. Therefore, when setting it to what it currently is, this technically, in theory, would do nothing. And I'm not necessarily trying to flip the car on command, I'm trying to track the Y angle of the car, and when it is in the 130-250 range, the car re-flips. I already know how to flip a car. It's just this bit that's confusing me.
did u try it? if not then ****** for some research.. i found thousans answers online.. also im quite sure it work just try.
Reply
#6

Quote:
Originally Posted by dr.lozer
Посмотреть сообщение
GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);

i think this will work
Coz i saw this on moneypimp's satdm
That would get / set the vehicle's position, not the angles. The only angle you can set (that I've seen) for a vehicle would be the Z angle, with the SetVehicleZAngle method.

However, you are able to track all angles of the vehicle with the GetVehicleRotationQuat method.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)