03.09.2009, 21:16
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.
VehicleJump
You can make a vehicle go up or down. I usually set height to 1.0.
StopVehicle
This surprisingly stops the vehicle... :P
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); }
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); }
This surprisingly stops the vehicle... :P
Code:
stock StopVehicle(vehicleid){ SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0); }