Some useful 0.3 functions.
#1

These function can also be used for players. Just change the functions to the ones that belong to players. GetVehicleVelocity will be GetPlayerVelocity... so on.

BoostVehicle
You can increase/decrease vehicle speed with this function. It's recommended to not go higher than 2.0 or lower than -2.0. Using 0.25 as speed is fine.
Code:
stock BoostVehicle(vehicleid, Float:speed){
	new Float:X, Float:Y, Float:Z, Float:A;
	GetVehicleZAngle(vehicleid, A);
	GetVehicleVelocity(vehicleid, X, Y, Z);
	X += (speed * floatsin(-A, degrees));
	Y += (speed * floatcos(-A, degrees));
	SetVehicleVelocity(vehicleid, X, Y, Z);
}
VehicleJump
You can make a vehicle go up or down. I usually set height to 1.0.
Code:
stock VehicleJump(vehicleid, Float:height){
	new Float:X, Float:Y, Float:Z;
	GetVehicleVelocity(vehicleid, X, Y, Z);
	SetVehicleVelocity(vehicleid, X, Y, Z+height);
}
StopVehicle
This surprisingly stops the vehicle... :P
Code:
stock StopVehicle(vehicleid){
	SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0);
}
Reply


Messages In This Thread
Some useful 0.3 functions. - by Tr1viUm - 03.09.2009, 21:16
Re: Some useful 0.3 functions. - by amrour - 03.09.2009, 21:19
Re: Some useful 0.3 functions. - by Tr1viUm - 03.09.2009, 21:20
Re: Some useful 0.3 functions. - by Correlli - 03.09.2009, 21:22
Re: Some useful 0.3 functions. - by Donny_k - 03.09.2009, 22:23

Forum Jump:


Users browsing this thread: 1 Guest(s)