[Tutorial] [0.3z] Fix for Bullet Crasher
#15

Quote:
Originally Posted by BroZeus
View Post
According to me whole code is wrong....
Nice idea but some mistakes...
You say "OffSet" but its coords of bullet hit...
It worked for you beacuse you must have tested it in Blue berry farm which coords are 0.0,0.0,0.0 the code u used will work there and that not accurate
use this one instead --
pawn Code:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{

    if( hittype == BULLET_HIT_TYPE_PLAYER ) // Bullet Crashing uses just this hittype
    {
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
fX = pos[0] <= fX ? fX-pos[0] : fX+pos[0];
fY = pos[1] <= fY ? fY-pos[1] : fY+pos[1];
fZ= pos[2] <= fZ ? fZ-pos[2] : fZ+pos[2];

        if( !( -20.0 <= fX <= 20.0 ) || !( -20.0 <= fY <= 20.0 ) || !( -20.0 <= fZ <= 20.0 ) ) // a valid offset, it's impossible that a offset bigger than 20 is legit (also less than -20.0 is impossible, not used by this hack, but still, let's check for it, just for the future, who knows what hacks will appear)
        {
            /*
                If you want, here you can kick the cheater
            */

            return 0; // let's desynchronize that bullet, so players won't crash
        }
    }
    return 1;
}
Code needs to be tested though*
Correct me if i am wrong.....
https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot

Look at the first note. Before saying something, please be sure. Check the wiki first and test it yourself then.
Reply


Messages In This Thread
[0.3z] Fix for Bullet Crasher - by IstuntmanI - 04.09.2014, 18:28
Re: [0.3z] Fix for Bullet Crasher - by Sledgehammer - 04.09.2014, 19:29
Re: [0.3z] Fix for Bullet Crasher - by Pottus - 04.09.2014, 19:58
Re: [0.3z] Fix for Bullet Crasher - by DamonD - 04.09.2014, 20:19
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 04.09.2014, 20:24
Re: [0.3z] Fix for Bullet Crasher - by Rifa4life - 04.09.2014, 20:26
Re: [0.3z] Fix for Bullet Crasher - by iAnonymous - 04.09.2014, 21:54
Re: [0.3z] Fix for Bullet Crasher - by Pottus - 04.09.2014, 22:25
Re: [0.3z] Fix for Bullet Crasher - by Arjanz - 05.09.2014, 03:19
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 05.09.2014, 05:29
Re: [0.3z] Fix for Bullet Crasher - by iAnonymous - 05.09.2014, 11:10
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 05.09.2014, 11:19
Re: [0.3z] Fix for Bullet Crasher - by Winchaster - 05.09.2014, 11:37
Re: [0.3z] Fix for Bullet Crasher - by BroZeus - 05.09.2014, 15:32
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 05.09.2014, 16:19
Re: [0.3z] Fix for Bullet Crasher - by BroZeus - 06.09.2014, 07:09
Re: [0.3z] Fix for Bullet Crasher - by Battlezone - 06.09.2014, 07:32
Re: [0.3z] Fix for Bullet Crasher - by Vince - 06.09.2014, 08:27
Re: [0.3z] Fix for Bullet Crasher - by kurta999 - 06.09.2014, 10:58
Re: [0.3z] Fix for Bullet Crasher - by Calgon - 06.09.2014, 14:54
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 06.09.2014, 15:01
Re: [0.3z] Fix for Bullet Crasher - by dugi - 06.09.2014, 20:48
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 06.09.2014, 21:15
Re: [0.3z] Fix for Bullet Crasher - by Venice - 07.09.2014, 03:34
Re: [0.3z] Fix for Bullet Crasher - by Vince - 07.09.2014, 08:59
Re: [0.3z] Fix for Bullet Crasher - by PawnOX - 15.09.2014, 03:57
Re: [0.3z] Fix for Bullet Crasher - by martintasin - 11.01.2015, 13:16
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 11.01.2015, 15:21
Re: [0.3z] Fix for Bullet Crasher - by martintasin - 11.01.2015, 16:11
Re: [0.3z] Fix for Bullet Crasher - by Yera96 - 15.01.2015, 12:49
[0.3z] Fix for Weapon Crasher - by kaZax - 17.01.2015, 05:24
Re: [0.3z] Fix for Bullet Crasher - by TheRaGeLord - 26.01.2015, 04:27
Re: [0.3z] Fix for Bullet Crasher - by ProBrad - 03.02.2015, 14:56
Re: [0.3z] Fix for Weapon Crasher - by ProBrad - 03.02.2015, 14:58
Re: [0.3z] Fix for Bullet Crasher - by Akcent_Voltaj - 18.02.2015, 17:33
Re: [0.3z] Fix for Weapon Crasher - by HydraHumza - 28.02.2015, 05:58
Re: [0.3z] Fix for Weapon Crasher - by wampiros6 - 24.03.2015, 17:09
Re: [0.3z] Fix for Bullet Crasher - by Luca12 - 24.03.2015, 17:20
Re: [0.3z] Fix for Bullet Crasher - by FernandoLight - 22.04.2015, 18:48
Re: [0.3z] Fix for Bullet Crasher - by VenomMancer - 21.06.2015, 17:08
Re: [0.3z] Fix for Bullet Crasher - by IstuntmanI - 21.06.2015, 17:13
Re: [0.3z] Fix for Bullet Crasher - by Konverse - 21.06.2015, 17:17
Re: [0.3z] Fix for Bullet Crasher - by Lucky™ - 22.06.2015, 15:34
Re: [0.3z] Fix for Bullet Crasher - by buburuzu19 - 09.07.2015, 06:17
Re: [0.3z] Fix for Bullet Crasher - by dugi - 09.07.2015, 09:17
Re: [0.3z] Fix for Bullet Crasher - by buburuzu19 - 14.07.2015, 15:17
Re: [0.3z] Fix for Bullet Crasher - by Omirrow - 17.07.2015, 15:12
Re: [0.3z] Fix for Bullet Crasher - by uZ1 - 26.07.2015, 23:04
Re: [0.3z] Fix for Bullet Crasher - by MD5 - 01.11.2015, 11:04

Forum Jump:


Users browsing this thread: 7 Guest(s)