PDA

View Full Version : New cheat?


JR_Junior
19/04/2017, 12:14 AM
Hello!
It looks like it's a type of cheat that says it's coming out of an invalid vehicle.
Did I solve this with the code below?

public OnPlayerExitVehicle(playerid, vehicleid)
{
if(IsValidVehicle(vehicleid) || vehicleid >= MAX_VEHICLES) return Kick(playerid);
}


[debug] Run time error 4: "Array index out of bounds"
[16:03:42] [debug] Accessing element at index 2000 past array upper bound 1999
[16:03:42] [debug] AMX backtrace:
[16:03:42] [debug] #0 00149d74 in public OnPlayerExitVehicle (4, 2000) from GM.amx
[16:03:42] [debug] Run time error 4: "Array index out of bounds"
[16:03:42] [debug] Accessing element at index 2001 past array upper bound 1999
[16:03:42] [debug] AMX backtrace:
[16:03:42] [debug] #0 00149d74 in public OnPlayerExitVehicle (4, 2001) from GM.amx
[16:03:42] [debug] Run time error 4: "Array index out of bounds"
[16:03:42] [debug] Accessing element at index 2002 past array upper bound 1999
[16:03:42] [debug] AMX backtrace:
[16:03:42] [debug] #0 00149d74 in public OnPlayerExitVehicle (4, 2002) from GM.amx
[16:03:42] [debug] Run time error 4: "Array index out of bounds"
[16:03:42] [debug] Accessing element at index 2003 past array upper bound 1999
[16:03:42] [debug] AMX backtrace:
[16:03:42] [debug] #0 00149d74 in public OnPlayerExitVehicle (4, 2003) from GM.amx
[16:03:42] [debug] Run time error 4: "Array index out of bounds"
[16:03:42] [debug] Accessing element at index 2004 past array upper bound 1999
...

ISmokezU
19/04/2017, 12:40 AM
Idk but why are you checking if it's equal to MAX_VEHICLES? Just check if it's a valid vehicle.

public OnPlayerExitVehicle(playerid, vehicleid)
{
if(!IsValidVehicle(vehicleid) Kick(playerid);
printf("Vehicle ID: %i", vehicleid);
}

JR_Junior
19/04/2017, 12:48 AM
Idk but why are you checking if it's equal to MAX_VEHICLES? Just check if it's a valid vehicle.

public OnPlayerExitVehicle(playerid, vehicleid)
{
if(!IsValidVehicle(vehicleid) Kick(playerid);
printf("Vehicle ID: %i", vehicleid);
}

Ok! Thanks!