SA-MP Forums Archive
Knock Back? - 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: Knock Back? (/showthread.php?tid=229663)



Knock Back? - Kitten - 22.02.2011

Solved


Re: Knock Back? - deather - 22.02.2011

Consider player1 and player2.
player1 - On ground
player2 - In vehicle to ram player1

First check if the player1 is having a M4/Deagle when he fire s(OnPlayerKeyStateChange?), and then GetPlayerCameraFrontVector and GetPlayerCameraPos to get the player1's aim position.

Check if the aim position is matching with the GetPlayerPos of the player2 who is trying to ram the player1. If it matches, SetPlayerPos of the player2 some distance back.