Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Spice on Jul 25, 2015, 08:12 AM

Title: how to get a vehicle with a specific angle...
Post by: Spice on Jul 25, 2015, 08:12 AM
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...?
Title: Re: how to get a vehicle with a specific angle...
Post by: MacTavish on Jul 25, 2015, 08:24 AM
It should be

veh.EulerAngle.z = 275.8177;

I've tested player.Vehice.Angle it returns

x,y,z,w
Title: Re: how to get a vehicle with a specific angle...
Post by: Spice on Jul 25, 2015, 08:32 AM
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.....
Title: Re: how to get a vehicle with a specific angle...
Post by: EK.IceFlake on Jul 25, 2015, 08:43 AM
275.8177... It doesn't seem like a radian. It expects a radian use a degrees to radians converter.
Title: Re: how to get a vehicle with a specific angle...
Post by: DizzasTeR on Jul 25, 2015, 08:45 AM
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.
Title: Re: how to get a vehicle with a specific angle...
Post by: MacTavish on Jul 25, 2015, 08:46 AM
I tried

print(player.Angle);
It returned -0.168599

And then i did

player.Vehice.EulerAngle.z = -0.168599;
And it worked fine
Title: Re: how to get a vehicle with a specific angle...
Post by: Spice on Jul 25, 2015, 03:04 PM
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