01.01.2013, 05:31
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.
Any help would be HIGHLY appreciated. Thanks!
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;
}