SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 10/07/2015, 12:01 AM   #1
Emmet_
Guest
 
Posts: n/a
Default OnPlayerInvalidBulletShot

OnPlayerInvalidBulletShot

All this does is detects invalid bullets and passes them to a callback. This should prevent bullet crashers from crashing players. This was apparently fixed in 0.3.7 but it has been patched I believe.

pawn Code:
public OnPlayerInvalidBulletShot(playerid, reason);

The "reason" parameter contains a value relative to these error IDs:

BULLET_INVALID_WEAPON_IDAn invalid weapon ID was used to fire an invalid bullet.
BULLET_INVALID_HIT_TYPEAn invalid hit type was detected.
BULLET_INVALID_HIT_IDAn invalid hit ID was detected.
BULLET_OUT_OF_RANGEThe bullet was out of range from the player.
BULLET_RAPID_SHOTThe bullet was fired too quickly after the previous one.

All invalid bullets are automatically discarded to prevent further damage.

Download: https://www.dropbox.com/s/6c7kxjy0bi...OPIBS.inc?dl=1
  Reply With Quote
Old 10/07/2015, 12:41 AM   #2
alex10
Big Clucker
 
alex10's Avatar
 
Join Date: Sep 2014
Posts: 82
Reputation: 14
Default Re: OnPlayerInvalidBulletShot

nice job
__________________
Need a Mapper??(TDM/RP)
Contact me By PMS or Skype majid984
alex10 is offline   Reply With Quote
Old 10/07/2015, 05:51 AM   #3
eXeDev
Banned
 
Join Date: May 2014
Location: United States
Posts: 78
Reputation: 43
Default Re: OnPlayerInvalidBulletShot

THE GODS HAVE OFFERED US A SACRIFICE!
eXeDev is offline   Reply With Quote
Old 10/07/2015, 10:32 PM   #4
Sime30
Huge Clucker
 
Join Date: Oct 2012
Location: Should I stay or should I go
Posts: 348
Reputation: 31
Default Re: OnPlayerInvalidBulletShot

Yo Emmet, nice work there. Could you tell me does your inc fixes these things I found today in tutorial section?

http://forum.sa-mp.com/showthread.php?t=581140

http://forum.sa-mp.com/showthread.php?t=581037

http://forum.sa-mp.com/showthread.php?t=581129

Thanks!
Sime30 is offline   Reply With Quote
Old 11/07/2015, 12:09 AM   #5
Emmet_
Guest
 
Posts: n/a
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by Sime30 View Post
Yo Emmet, nice work there. Could you tell me does your inc fixes these things I found today in tutorial section?

http://forum.sa-mp.com/showthread.php?t=581140

http://forum.sa-mp.com/showthread.php?t=581037

http://forum.sa-mp.com/showthread.php?t=581129

Thanks!
It should detect all invalid bullets fired, hopefully this makes the bullet crasher fully obsolete. I did some extensive testing on a 20+ player server without issues. Also, it should even detect rapid fire!
  Reply With Quote
Old 11/07/2015, 01:21 AM   #6
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,802
Reputation: 1160
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by Emmet_ View Post
It should detect all invalid bullets fired, hopefully this makes the bullet crasher fully obsolete. I did some extensive testing on a 20+ player server without issues. Also, it should even detect rapid fire!
It will. The most recent hack release uses invalid weapon IDs to send bullets, primarily crashing players.

As for rapid fire, people should be careful when it comes to using scripts that literally stall the server (probably inefficient object editors). Server hangs are usually create fundamental false-alarms.

I would have instead just desynced every bullet instead of making a callback anyway.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 10/07/2015, 11:01 PM   #7
muzammilfreeman
Huge Clucker
 
muzammilfreeman's Avatar
 
Join Date: Dec 2014
Location: In The World Of Roleplay.
Posts: 242
Reputation: 44
Default Re: OnPlayerInvalidBulletShot

Awesome job man!
__________________
Server Information:

SA-MP: samp.ne-rp.net
FORUMS: www.ne-rp.net/forums
TeamSpeak3: ts.ne-rp.net
UCP: cp.ne-rp.net
Shop: shop.ne-rp.net

JOIN NOW TO EXPLORE AMAZING FEATURES[STABLE 40+ DAILY PLAYERBASE]
muzammilfreeman is offline   Reply With Quote
Old 11/07/2015, 12:41 AM   #8
XxBaDxBoYxX
Big Clucker
 
Join Date: Aug 2013
Posts: 93
Reputation: 89
Default Re: OnPlayerInvalidBulletShot

I love includes made by you Emmet_, They are always trustworthy.
Thanks!
XxBaDxBoYxX is offline   Reply With Quote
Old 11/07/2015, 02:15 AM   #9
Sime30
Huge Clucker
 
Join Date: Oct 2012
Location: Should I stay or should I go
Posts: 348
Reputation: 31
Default Re: OnPlayerInvalidBulletShot

@Emmet_ & @Lorenc_ - Thanks guys. I was looking for a mastercode that would get rid of those hacks and finally found it. Thanks Emmet_ for the code. Love <3
Sime30 is offline   Reply With Quote
Old 11/07/2015, 12:02 PM   #10
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,802
Reputation: 1160
Default Re: OnPlayerInvalidBulletShot

Emmet_, I can see a bug already:

pawn Code:
} else if (!((22 <= weaponid <= 34) || weaponid == 38)) {

If the player has a minigun, it looks like it won't work. Mine should work (barely any different):

pawn Code:
if( !( 22 <= weaponid <= 34 ) && weaponid != 38 )

Edit: Both ways work, whoops!
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777


Last edited by Lorenc_; 11/07/2015 at 03:05 PM.
Lorenc_ 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



All times are GMT. The time now is 07:06 AM.


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