Invalid vehicle and ispassenger
#1

Hello everybody. I have problem with my server. Some cheaters or buggers buging my server. In server log I have these lines:



Код:
[21:00:50] [debug] AMX backtrace:
[21:00:50] [debug] #0 00044b50 in public OnPlayerEnterVehicle (playerid=0, vehicleid=48404, ispassenger=20) at D:\Ћaidimai\LVGM\LVGM\gamemodes\SAMP.pwn:5767
[21:00:50] Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID
[21:00:50] [debug] Run time error 4: "Array index out of bounds"
[21:00:50] [debug]  Accessing element at index 63781 past array upper bound 999
[21:00:50] [debug] AMX backtrace:
[21:00:50] [debug] #0 00044b50 in public OnPlayerEnterVehicle (playerid=0, vehicleid=63781, ispassenger=175) at D:\Ћaidimai\LVGM\LVGM\gamemodes\SAMP.pwn:5767
[21:00:50] Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID
[21:00:50] [debug] Run time error 4: "Array index out of bounds"
[21:00:50] [debug]  Accessing element at index 11664 past array upper bound 999
[21:00:50] [debug] AMX backtrace:
[21:00:50] [debug] #0 00044b50 in public OnPlayerEnterVehicle (playerid=0, vehicleid=11664, ispassenger=56) at D:\Ћaidimai\LVGM\LVGM\gamemodes\SAMP.pwn:5767
[21:00:50] Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID
[21:00:50] [debug] Run time error 4: "Array index out of bounds"
[21:00:50] [debug]  Accessing element at index 37610 past array upper bound 999
[21:00:50] [debug] AMX backtrace:
[21:00:50] [debug] #0 00044b50 in public OnPlayerEnterVehicle (playerid=0, vehicleid=37610, ispassenger=142) at D:\Ћaidimai\LVGM\LVGM\gamemodes\SAMP.pwn:5767
[21:00:50] Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID
[21:00:50] [debug] Run time error 4: "Array index out of bounds"
[21:00:50] [debug]  Accessing element at index 26929 past array upper bound 999
[21:00:50] [debug] AMX backtrace:
But I don't have a lot of vehicles, It can't be such vehicleid. How to make protection against this?
Reply
#2

It's not cheaters, your code is bugged.

You are accessing an array out off bounds.

EG:

pawn Код:
new array[5];
array[10] = 6;//array is size '5' but we are trying to access '10'
This:
Код:
Accessing element at index 11664 past array upper bound 999
Means you have an array that is size 1000, and you are accessing 11664.
Reply
#3

No. I don't have this problem. I am not a newbie. It is something called "Server fucker". This thing sends onplayerentervehicle callback with invalid numbers. There is everything okay with my arrays.
Reply
#4

If that's actually what it is called you should delete that ASAP.

It seems you are using the 'vehicleid' as an index to an array?
Reply
#5

Try using the native IsValidVehicle:

pawn Код:
native IsValidVehicle(vehicleid); // It works, but it's not in the includes for some reason (https://sampwiki.blast.hk/wiki/IsValidVehicle)

public OnPlayerEnterVehicle(playerid, vehicleid)
{
    if(!IsValidVehicle(vehicleid))
    {
        // Whatever you want to do with him
        Ban(playerid);
        return 0;
    }

    // The rest of your code
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)