SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/03/2019, 09:42 AM   #1
DavidMurphy
Little Clucker
 
Join Date: Jan 2019
Posts: 4
Reputation: 0
Question Onplayerweaponshot bug

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!
DavidMurphy is offline   Reply With Quote
Old 11/03/2019, 12:40 PM   #2
J0sh...
Banned
 
Join Date: Aug 2014
Location: Hamburger
Posts: 1,305
Reputation: 461
Default Re: Onplayerweaponshot bug

OnPlayerShootDynamicObject
J0sh... is offline   Reply With Quote
Old 12/03/2019, 08:55 AM   #3
DavidMurphy
Little Clucker
 
Join Date: Jan 2019
Posts: 4
Reputation: 0
Default Re: Onplayerweaponshot bug

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...
DavidMurphy is offline   Reply With Quote
Old 13/03/2019, 08:52 AM   #4
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,794
Reputation: 223
Default Re: Onplayerweaponshot bug

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)
Riddick94 is offline   Reply With Quote
Old 13/03/2019, 09:08 AM   #5
Kane
Gangsta
 
Kane's Avatar
 
Join Date: Sep 2012
Posts: 807
Reputation: 123
Default Re: Onplayerweaponshot bug

IIRC OnPlayerWeaponShot will not be called if you're shooting a dynamic object unless OnPlayerShootDynamicObject is called.
__________________
Los Santos Roleplay - Development team
@ls-rp.io
Kane is offline   Reply With Quote
Old 13/03/2019, 11:29 AM   #6
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,518
Reputation: 305
Default Re: Onplayerweaponshot bug

IIRC you can't do that unless the object is moving, which you can do by GetPlayerSurfingObject??
Logic_ is offline   Reply With Quote
Old 18/03/2019, 10:19 AM   #7
DavidMurphy
Little Clucker
 
Join Date: Jan 2019
Posts: 4
Reputation: 0
Default Re: Onplayerweaponshot bug

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
DavidMurphy is offline   Reply With Quote
Old 21/03/2019, 02:01 AM   #8
DTV
Gangsta
 
DTV's Avatar
 
Join Date: Dec 2010
Posts: 545
Reputation: 125
Default Re: Onplayerweaponshot bug

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.
__________________

DTV is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerWeaponShot StR_MaRy Scripting Help 6 14/11/2016 01:33 PM
[Ajuda] OnPlayerWeaponShot OtimoJogo PortuguÍs/Portuguese 5 04/09/2016 02:29 PM
OnPlayerWeaponShot PaulDinam Bug Reports 10 09/01/2015 10:54 PM
OnPlayerWeaponShot Admigo Scripting Help 3 15/03/2014 09:50 AM
OnPlayerWeaponShot Bug Locky_ Bug Reports 2 23/02/2014 01:14 AM


All times are GMT. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.