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



Question about AttanchedObject - Rabea - 23.08.2014

Hello,
i'm trying to do tazer with object id 18642,
but when i shoot/hit nothing happened, my question is:
How to make an object to hit/shoot,
my code when i use /tazer:
Код:
 SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
the code for guns is :
Код:
 if(GetPlayerWeapon(Shooter) == 23)
so what is the code for objects?


Re: Question about AttanchedObject - DavidBilla - 23.08.2014

You can't really mention a normal object id under GetPlayerWeapon. You have to use other alternatives. Try attaching another object and/or moving it and create a reaction when it is in the player's radius.


Re: Question about AttanchedObject - Rabea - 23.08.2014

i didn't understand you, explain good


Re: Question about AttanchedObject - DavidBilla - 23.08.2014

Well, what you actually want to happen is,you attach a taser object which should taze the player when shot. But you cannot add the id of that object with GetPlayerWeapon function since that object is not defined as an actual weapon in san Andreas.
What you have to do is, attach another small object which is in the size of a bullet or something and when you press fire that mini object will move in a certain direction,you set a timer and check if the object is in the range of the player you are attacking. If it's true, you use TogglePlayerControllable function to make the player frozen.

If you want me to help in the form of typing actual pawn code,i can help with that too.


Re: Question about AttanchedObject - Rabea - 23.08.2014

Thanks, i need ur help !


Re: Question about AttanchedObject - Rabea - 23.08.2014

Will you help me?


Re: Question about AttanchedObject - Rabea - 23.08.2014

bump


Re: Question about AttanchedObject - Rabea - 23.08.2014

Anyone?


Re: Question about AttanchedObject - Kenxxx - 24.08.2014

You can use Spidtrols to make tazer for cops. Why dont you use this ?


Re: Question about AttanchedObject - Rabea - 24.08.2014

Sd pistol is more for rp servers i know, but if player running i cant shoot him ( buggy ) so i decided to use this...