SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/04/2020, 06:42 AM   #1
beckzy
Beta Tester
 
Join Date: Dec 2006
Posts: 1,276
Reputation: 172
Default Anti firing bullets from non-bullet weapon hack

In recent days players in my server have been suffering from a game freeze/crash caused by hackers firing bullets from weapon ID 0 (a non-bullet weapon). This was supposedly fixed in the 0.3.7-R2 server, but it doesn't seem to be. This is how you can fix it:

Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    switch (weaponid)
    {
        case 22 .. 34, 38:
        {
            // valid bullet weapon
        }
        default:
        {
            // invalid bullet weapon
            return 0; // desync the shot
        }
    }
    return 1;
}
__________________
beckzy is offline   Reply With Quote
Old 07/04/2020, 07:50 AM   #2
MarianImmortalGod
Big Clucker
 
Join Date: Mar 2018
Posts: 115
Reputation: 1
Default Re: Anti firing bullets from non-bullet weapon hack

So we need to determine every single weapon that will be used in our server ?

or we can just put
Code:
switch (weaponid)
    {
        default:
        {
            // invalid bullet weapon
            return 0; // desync the shot
        }
    }
MarianImmortalGod is offline   Reply With Quote
Old 07/04/2020, 08:23 AM   #3
beckzy
Beta Tester
 
Join Date: Dec 2006
Posts: 1,276
Reputation: 172
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by MarianImmortalGod View Post
So we need to determine every single weapon that will be used in our server ?

or we can just put
Code:
switch (weaponid)
    {
        default:
        {
            // invalid bullet weapon
            return 0; // desync the shot
        }
    }
That'll desync every shot for every weapon. Use the code I posted.
__________________
beckzy is offline   Reply With Quote
Old 07/04/2020, 02:23 PM   #4
Kasichok
Big Clucker
 
Kasichok's Avatar
 
Join Date: Sep 2018
Location: weed farm
Posts: 96
Reputation: 35
Default Re: Anti firing bullets from non-bullet weapon hack

weird i tried such thing on my server (R2) didnt crash anyone
__________________



STRESSED? TRY KASICHOK AND RELAX


Kasichok is offline   Reply With Quote
Old 07/04/2020, 02:30 PM   #5
beckzy
Beta Tester
 
Join Date: Dec 2006
Posts: 1,276
Reputation: 172
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by Kasichok View Post
weird i tried such thing on my server (R2) didnt crash anyone
Is your server version also R2-2? Also did you try weapon ID 0? It's weapon ID 0 that was being used to crash players in my server (0.3.7 R2-2).
__________________
beckzy is offline   Reply With Quote
Old 07/04/2020, 02:34 PM   #6
Kasichok
Big Clucker
 
Kasichok's Avatar
 
Join Date: Sep 2018
Location: weed farm
Posts: 96
Reputation: 35
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by beckzy View Post
Is your server version also R2-2? Also did you try weapon ID 0? It's weapon ID 0 that was being used to crash players in my server (0.3.7 R2-2).
Yes and yes
__________________



STRESSED? TRY KASICHOK AND RELAX


Kasichok is offline   Reply With Quote
Old 07/04/2020, 03:08 PM   #7
beckzy
Beta Tester
 
Join Date: Dec 2006
Posts: 1,276
Reputation: 172
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by Kasichok View Post
Yes and yes
Someone must've updated the tool that does it (or made their own?) . OnPlayerWeaponShot rapidly printed that a player was using weapon ID 0 to fire bullets on my server (my 0.3.7 R2-2 server).
__________________
beckzy is offline   Reply With Quote
Old 07/04/2020, 04:08 PM   #8
Kasichok
Big Clucker
 
Kasichok's Avatar
 
Join Date: Sep 2018
Location: weed farm
Posts: 96
Reputation: 35
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by beckzy View Post
Someone must've updated the tool that does it (or made their own?) . OnPlayerWeaponShot rapidly printed that a player was using weapon ID 0 to fire bullets on my server (my 0.3.7 R2-2 server).
Yea he prob edited

heres my debug:
Code:
playerid | weaponid | hittype | hitid 
0              0           1      1
no crash no freeze
__________________



STRESSED? TRY KASICHOK AND RELAX


Kasichok is offline   Reply With Quote
Old 07/04/2020, 07:07 PM   #9
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 893
Reputation: 63
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by Kasichok View Post
weird i tried such thing on my server (R2) didnt crash anyone
Maybe you might have some mods installed on your SA-MP? Like SA-MP Addon, or GTA SA Crashfix ASI etc.
Uberanwar is offline   Reply With Quote
Old 07/04/2020, 08:59 PM   #10
Kasichok
Big Clucker
 
Kasichok's Avatar
 
Join Date: Sep 2018
Location: weed farm
Posts: 96
Reputation: 35
Default Re: Anti firing bullets from non-bullet weapon hack

Quote:
Originally Posted by Uberanwar View Post
Maybe you might have some mods installed on your SA-MP? Like SA-MP Addon, or GTA SA Crashfix ASI etc.
Iv'e got only anti afk if that somehow prevents this
__________________



STRESSED? TRY KASICHOK AND RELAX


Kasichok 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
[FilterScript] Anti-Cheat ANTIFLY\ANTI GOD\ANTI SKIN BUG\ANTI MONEY HACK\ANTI JETPACK HACK\ANTI GODOFCARS\ANTI FAKEKILL RedMF Lanšamentos/Releases 15 19/07/2018 06:29 PM
[FilterScript] Anti-Lag/Anti-Lead/MTA-Bullet Hit Sync System v0.1 (Weapon Damages Synced) Matz Filterscripts 21 26/05/2018 03:37 PM
[FilterScript] PSYCHOBABYKILLA's Weapon / Ammo Anticheat Cant Hack A Bullet PSYCHOBABYKILLA Filterscripts 0 23/04/2015 04:10 AM
[FilterScript] PMH's Anti Weapon Hack!!! + Ammo hack PMH Filterscripts 4 25/01/2015 11:12 AM
[Bug?] Sniper bullets not firing Admigo Scripting Help 6 19/01/2014 12:08 AM


All times are GMT. The time now is 10:39 PM.


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