how to get a vehicle with a specific angle...

Started by Spice, Jul 25, 2015, 08:12 AM

Previous topic - Next topic

Spice

i am trying to do that if i type getcar car alwasys spawn on a specific angle...but when i use

veh.Angle = 275.8177;
my server stop working....
can anyone tell me the problem and solution...?

MacTavish

#1
It should be

veh.EulerAngle.z = 275.8177;

I've tested player.Vehice.Angle it returns

x,y,z,w

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Spice

i have tried
Quote
Quote from: Beztone on Jul 25, 2015, 08:24 AMIt should be

veh.EulerAngle.z = 275.8177;
but now server is not stopping(crashing) but it is not getting car on given angle.....

EK.IceFlake

275.8177... It doesn't seem like a radian. It expects a radian use a degrees to radians converter.

DizzasTeR

You can get Angle in two ways, the normal vehicle.Angle returns in Quaternion, and vehicle.EulerAngle returns the angle in Vector. So try

veh.EulerAngle = Vector( rx, ry, rz );
Don't forget to replace the rx, ry and rz with your needed angles.

MacTavish

I tried

print(player.Angle);
It returned -0.168599

And then i did

player.Vehice.EulerAngle.z = -0.168599;
And it worked fine

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Spice

it worked just like this.....
first get angle( rx, ry, rz ) by
PrivMessage(player,">>>" + vehicle.EulerAngle + "...");then when player get vehicle add this
veh.EulerAngle = Vector( 2.91636, 2.9141, -1.56754 );//rx, ry, rzthats all thanks to all