SA-MP Forums Archive
Set Player Velocity - 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)
+--- Thread: Set Player Velocity (/showthread.php?tid=599553)



Set Player Velocity - YouServ - 27.01.2016

----


Re: Set Player Velocity - Sascha - 27.01.2016

e.g. like this:
Код:
	new Float:a, Float:vx, Float:vy;
	GetPlayerFacingAngle(playerid, a);
	vx = 0.5 * floatsin(-(a+90), degrees);
	vy = 0.5 * floatcos(-(a+90), degrees);
	SetPlayerVelocity(playerid, vx, vy, 0.00);
(change the "0.5" to adjust the speed)