[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)