SA-MP Forums Archive
Is it possible to make flying cars like cheat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is it possible to make flying cars like cheat (/showthread.php?tid=274128)



Is it possible to make flying cars like cheat - jueix - 04.08.2011

hello im wonder if its possible to make it like when a player connects or gets in a car or writes a command if it can be able to fly like the flying car cheat. If it is can you help me make this command for my stunting server thanks.


Re: Is it possible to make flying cars like cheat - [HiC]TheKiller - 04.08.2011

I don't think that you can to the smoothness that you may want, but it's probably best to attach a object to the vehicle / player and you can then move the object around in according to where the player moves the mouse, etc.


Re: Is it possible to make flying cars like cheat - ⒹⒾⓇⒺⒸⓉⓄⓇ - 04.08.2011

Yes, but it won't be smooth, it's something like Superman on The Eclipse..


Re: Is it possible to make flying cars like cheat - Danny - 04.08.2011

It's possible, but it won't be very 'smooth' like the flyhacks your mentioned.
Just warp a vehicle into the air with SetVehicleVelocity. Then, use a custom function like this to set the vehicle speed:

Код:
stock SetVehicleSpeed(vehicleid, Float: speed, mode = 1)
{
	new Float: vAngle;
	GetVehicleZAngle(vehicleid, vAngle);
	speed = ((!mode) ? (speed / 105.0) : (speed / 170.0));
	return SetVehicleVelocity(vehicleid, speed * floatsin(-vAngle, degrees), speed * floatcos(-vAngle, degrees), 0.0);
}
For example, use the speed 220 (mode 0). Then you'll have to make a timer where you repeat this function in (every 500 milliseconds for example)

Use SetVehicleZAngle to steer in the air. Good luck!