SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 11/07/2015, 02:44 PM   #11
Emmet_
Guest
 
Posts: n/a
Default Re: OnPlayerInvalidBulletShot

I tested it with the minigun and it appeared to be fine for me.

It works like this:

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

This condition checks if the weapon ID is between 22 and 34, or 38.

However, we're doing an inverse check by wrapping the condition with brackets, preceded with NOT (!):

Code:
if ( ! ( (22 <= weaponid <= 34) || weaponid == 38 ) )
  Reply With Quote
Old 11/07/2015, 03:22 PM   #12
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,800
Reputation: 1160
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by Emmet_ View Post
I tested it with the minigun and it appeared to be fine for me.

It works like this:

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

This condition checks if the weapon ID is between 22 and 34, or 38.

However, we're doing an inverse check by wrapping the condition with brackets, preceded with NOT (!):

Code:
if ( ! ( (22 <= weaponid <= 34) || weaponid == 38 ) )
Aha, didn't see that. Whoops!
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 12/07/2015, 03:51 AM   #13
BlowUP
Little Clucker
 
Join Date: Feb 2015
Posts: 14
Reputation: 0
Default Re: OnPlayerInvalidBulletShot

Test your Script Please ! its not working and giving false results ...
BlowUP is offline   Reply With Quote
Old 12/07/2015, 04:06 AM   #14
Emmet_
Guest
 
Posts: n/a
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by BlowUP View Post
Test your Script Please ! its not working and giving false results ...
Could you debug it and give me the results:

pawn Code:
public OnPlayerInvalidBulletShot(playerid, reason)
{
    printf("%i", reason);
}
  Reply With Quote
Old 12/07/2015, 07:00 AM   #15
codeshadow
Little Clucker
 
codeshadow's Avatar
 
Join Date: Nov 2014
Location: New York
Posts: 45
Reputation: 14
Default Re: OnPlayerInvalidBulletShot

After using this include some players cannot give damage to other players with certain weapons. There was a player who couldn't give damage with Desert Eagle, Combat Shotgun but was able to give damage by punching and using grande, minigun( did not test all the weapons). Same thing happened with me and some other players with same weapons.
codeshadow is offline   Reply With Quote
Old 12/07/2015, 08:16 AM   #16
Emmet_
Guest
 
Posts: n/a
Default Re: OnPlayerInvalidBulletShot

All bugs should be fixed now. Re-download the include and test.
  Reply With Quote
Old 12/07/2015, 08:19 AM   #17
n0minal
Banned
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,054
Reputation: 784
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by Emmet_ View Post
All bugs should be fixed now. Re-download the include and test.
Hey Emmet, doesn't 0.3.7 R2 prevent us from all bulletcrash hacks?
n0minal is offline   Reply With Quote
Old 12/07/2015, 08:25 AM   #18
Emmet_
Guest
 
Posts: n/a
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by ipsLeon View Post
Hey Emmet, doesn't 0.3.7 R2 prevent us from all bulletcrash hacks?
You're right, it should. This include should be deprecated for now.
  Reply With Quote
Old 12/07/2015, 08:32 AM   #19
n0minal
Banned
 
Join Date: Mar 2013
Location: Rio de Janeiro
Posts: 4,054
Reputation: 784
Default Re: OnPlayerInvalidBulletShot

Quote:
Originally Posted by Emmet_ View Post
You're right, it should. This include should be deprecated for now.
Yes but keep it up cause servers that still running in older versions may need this, great work btw, +5.
n0minal is offline   Reply With Quote
Old 16/07/2015, 05:38 AM   #20
Banana_Ghost
Huge Clucker
 
Banana_Ghost's Avatar
 
Join Date: Jul 2011
Location: United States
Posts: 240
Reputation: 45
Default Re: OnPlayerInvalidBulletShot

I wouldn't really deprecate this include, aside from the bullet crashers, everything else still works from what I tested.

Also,
PHP Code:
else if ((hittype == BULLET_HIT_TYPE_NONE) && GetPlayerDistanceFromPoint(playeridfXfYfZ) > 300.0 && (fX != 0.0 && fY != 0.0 && fZ != 0.0)) {
        return 
CallLocalFunction("OnPlayerInvalidBulletShot""ii"playeridBULLET_OUT_OF_RANGE), 0
needs a sniper check . I was able to trigger it without any cheats numerous times just by shooting at a GTA object in the distance.

http://pastebin.com/7EX20XrN

For anyone concerned, just replace the line:
PHP Code:
else if((hittype == BULLET_HIT_TYPE_NONE) && GetPlayerDistanceFromPoint(playeridfXfYfZ) > 300.0 && (fX != 0.0 && fY != 0.0 && fZ != 0.0))

// With

else if((hittype == BULLET_HIT_TYPE_NONE) && weaponid != WEAPON_SNIPER && GetPlayerDistanceFromPoint(playeridfXfYfZ) > 300.0 && (fX != 0.0 && fY != 0.0 && fZ != 0.0)) 
Banana_Ghost 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:54 PM.


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