[Tutorial] Anti firing bullets from non-bullet weapon hack
#1

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;
}
Reply
#2

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
        }
    }
Reply
#3

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.
Reply
#4

weird i tried such thing on my server (R2) didnt crash anyone
Reply
#5

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).
Reply
#6

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
Reply
#7

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).
Reply
#8

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
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)