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



Onplayerweaponshot bug - DavidMurphy - 11.03.2019

As long as I shoot when my character is on an object which is created by 'CreateDyanmicObject',the callback won't be called.Sorry for my bad English,but the problem is really serious.Help me plz!


Re: Onplayerweaponshot bug - J0sh... - 11.03.2019

OnPlayerShootDynamicObject


Re: Onplayerweaponshot bug - DavidMurphy - 12.03.2019

Quote:
Originally Posted by J0sh...
View Post
OnPlayerShootDynamicObject
No...what l mean is that when the character stands on an object while shooting,not shooting at the object...


Re: Onplayerweaponshot bug - Riddick94 - 13.03.2019

Quote:
Originally Posted by DavidMurphy
View Post
No...what l mean is that when the character stands on an object while shooting,not shooting at the object...
What? I'm trying to understand what's your point. Let me break it up into few steps scenario and say if I'm right or wrong:

1) You are standing with your character on the custom created dynamic object (CreateDynamicObject)
2) You start shooting (at anything/anywhere. It doesn't have to be native SA object, standard created object [CreateObject] or dynamic object [CreateDynamicObject])
3) OnPlayerWeaponShot isn't called.

Is that the correct procedure?

If so, I will give it a test later today, but I don't believe it isn't called.

How do you know it isn't called? Do you have any proof of it not being called at all? (both callbacks, OnPlayerWeaponShot and OnPlayerShootDynamicObject)


Re: Onplayerweaponshot bug - Kane - 13.03.2019

IIRC OnPlayerWeaponShot will not be called if you're shooting a dynamic object unless OnPlayerShootDynamicObject is called.


Re: Onplayerweaponshot bug - Logic_ - 13.03.2019

IIRC you can't do that unless the object is moving, which you can do by GetPlayerSurfingObject??


Re: Onplayerweaponshot bug - DavidMurphy - 18.03.2019

Quote:
Originally Posted by Riddick94
View Post
What? I'm trying to understand what's your point. Let me break it up into few steps scenario and say if I'm right or wrong:

1) You are standing with your character on the custom created dynamic object (CreateDynamicObject)
2) You start shooting (at anything/anywhere. It doesn't have to be native SA object, standard created object [CreateObject] or dynamic object [CreateDynamicObject])
3) OnPlayerWeaponShot isn't called.

Is that the correct procedure?

If so, I will give it a test later today, but I don't believe it isn't called.

How do you know it isn't called? Do you have any proof of it not being called at all? (both callbacks, OnPlayerWeaponShot and OnPlayerShootDynamicObject)
I used 'print' to make sure the callback was not called


Re: Onplayerweaponshot bug - DTV - 21.03.2019

Put OnPlayerShootDynamicObject in your script (even if you have no use for it) and make sure it returns true or 1, then try it again. This happened to me before and doing this fixed it.