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



:/ - WillyP - 09.10.2010

i had a idea of detecting a bullets path, and creating icons in its path, but i really have no clue on how i would do it, so if anyone has any ideas, tell me


Re: :/ - Zamaroht - 09.10.2010

With icons, you mean mapicons, objects, or pickups?
You will have to use the OnPlayerKeyStateChange callback to detect when someone presses the left click (that is, when he shot) and check the weapon he is currently carrying (you don't want to make trails if he is punching or throwing a grenade).
After that, you need to use the GetPlayerCameraFrontVector function, which will give you a player-relative position of where the player is aiming. You add several multipliers to the values gotten, sum the player's position to it, and create an object/pickup/mapicon.
Try to do it, if you get stuck or need further insight in this last part don't hesitate to ask.


Re: :/ - WillyP - 09.10.2010

Quote:
Originally Posted by Zamaroht
Посмотреть сообщение
With icons, you mean mapicons, objects, or pickups?
You will have to use the OnPlayerKeyStateChange callback to detect when someone presses the left click (that is, when he shot) and check the weapon he is currently carrying (you don't want to make trails if he is punching or throwing a grenade).
After that, you need to use the GetPlayerCameraFrontVector function, which will give you a player-relative position of where the player is aiming. You add several multipliers to the values gotten, sum the player's position to it, and create an object/pickup/mapicon.
Try to do it, if you get stuck or need further insight in this last part don't hesitate to ask.
yeah, icons

i tried for myself, and i got stuck at the multipliers


Re: :/ - Toni - 09.10.2010

https://sampforum.blast.hk/showthread.php?tid=138791

watch the vid:

https://sampforum.blast.hk/showthread.php?tid=137869


Re: :/ - WillyP - 10.10.2010

Quote:
Originally Posted by The Toni
Посмотреть сообщение
thanks


Re: :/ - Tee - 10.10.2010

For Hydras there are bullet paths (lil grey icons)


Re: :/ - Tommie1331 - 10.10.2010

lol you should have asked me ive had a script like that for ages dont no what to do with it lol but you got one now but remember youve always got my msn


Re: :/ - TheInnocentOne - 10.10.2010

Quote:
Originally Posted by Tommie1331
Посмотреть сообщение
lol you should have asked me ive had a script like that for ages dont no what to do with it lol but you got one now but remember youve always got my msn
Too bad it's probably ripped like 'your' object editor is.