![]() |
#1 |
Big Clucker
![]() ![]() Join Date: Jun 2011
Posts: 89
Reputation: 0
|
![]()
Hello everybody,
I was recently having this error on my server_log.txt file and lost some players because they were crashing out of the game when this error happens. This error is not being randomly generated or a malfunctioning on SAMP server. It's because some guy is attacking your server with a script that is can be found easily on any samp hack forums. Let's describe how this attack works. As you know PAWN language is based on 32-bit language so any data, string, float or integer can not be bigger then 32 bits. When 32 bit is fully used in this case our maximum number in bits is 1111111111111111111111111111111 which is equals to 2147483647. This also applies to floats. So attacker sends a bullet shot data to server with random float offsets which is around 2147483647 or bigger. When the offset position is bigger then this number SAMP Server can not process the data normally so sends malformed data to user and that makes client crash not server. To prevent this you can use this simple solution: When a offset is bigger then 2 billion and 147 million then do not send the weapon data. It can be done simply like this: Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(fX > 2140000000 || fY > 2140000000 || fZ > 2140000000) { new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, sizeof PlayerName); printf("[BULLET ATTACK] User %s(%d) is tried to shot an invalid bullet @ fX: %f, fY: %f, fZ: %f", PlayerName, playerid, fX, fY, fZ); return 0; } return 1; } Note: In order this to work you must have enabled lagmodcomp 1 in server.cfg EDIT: This system detects this attack but still invalid shot data still being sent. You can try to Ban attacker at the very moment when attack is detected. Simply add Code:
BanEx(playerid, "possible bullet crash"); Code:
return 0; Last edited by Emre__; 11/07/2015 at 02:03 PM. |
![]() |
![]() |
![]() |
#2 |
Big Clucker
![]() ![]() Join Date: Oct 2011
Posts: 192
Reputation: 47
|
![]()
There is a include that detects invalid bullet shots http://forum.sa-mp.com/showthread.php?t=581017
|
![]() |
![]() |
![]() |
#3 | |
Big Clucker
![]() ![]() Join Date: Jun 2011
Posts: 89
Reputation: 0
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2011
Location: Paradise Falls, CAℕADA
Posts: 791
Reputation: 369
|
![]()
Tbh, the SA-MP server should sort out such stuff and perform sanity checks.
|
![]() |
![]() |
![]() |
#5 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Australia
Posts: 4,269
Reputation: 1126
|
![]() |
![]() |
![]() |
![]() |
#6 |
Guest
Posts: n/a
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[HELP] [warning] Invalid shot data for player(0). Offset out of bounds. | VenomMancer | Server Support | 3 | 06/07/2015 04:28 PM |
Get player offset from a vehicle | Rodney Francalim | Scripting Help | 2 | 01/12/2014 01:42 AM |
Offset coordinates of player aiming to another player | Banditukas | Scripting Help | 8 | 02/11/2014 11:53 AM |
LOSING DATA SOLUTION... - INI | yos136 | Scripting Help | 3 | 08/02/2014 03:46 PM |
Detect if player has Shot someone else (And been Shot)? | DarrenReeder | Help Archive | 9 | 04/04/2010 05:37 PM |