open.mp forum
[Pawn] Laser pointer on weapons - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Laser pointer on weapons (/showthread.php?tid=1237)



Laser pointer on weapons - 3kisde - 2020-10-12

Hello bros, i want to know if it?s possible to make weapons to have laser pointer, and any idea or help of how to do this, Thank you!


RE: Laser pointer on weapons - LaszloR1 - 2020-10-13

Depends on what effect you wanna go for. This one can be done with SetPlayerAttachedObject:

https://youtu.be/SSvLRHKIdzk?t=66



But if you want to go with the more red dot on the head type of effect instead you need ColAndreas:

https://youtu.be/aSabQWqQBkI?t=38


RE: Laser pointer on weapons - 3kisde - 2020-10-13

Hello bro, i want like the first one, any idea?


RE: Laser pointer on weapons - LaszloR1 - 2020-10-14

When a player switches weapons it checks if the weapon they switched to has a laser, if it has you attach it onto the players hands. If they switch to another weapon you destroy the object.



Most of what you need is here.

https://www.open.mp/docs/scripting/functions/SetPlayerAttachedObject

And the laser objects are

https://dev.prineside.com/en/gtasa_samp_model_id/search/?q=laser



Good luck!


RE: Laser pointer on weapons - 3kisde - 2020-10-14

Thanks bro! have a wonderful day