Question about AttanchedObject
#1

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?
Reply
#2

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.
Reply
#3

i didn't understand you, explain good
Reply
#4

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.
Reply
#5

Thanks, i need ur help !
Reply
#6

Will you help me?
Reply
#7

bump
Reply
#8

Anyone?
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)