New cheat?
#1

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?
PHP Code:
public OnPlayerExitVehicle(playeridvehicleid)
{
   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
...
Reply
#2

Idk but why are you checking if it's equal to MAX_VEHICLES? Just check if it's a valid vehicle.

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

Quote:
Originally Posted by ISmokezU
View Post
Idk but why are you checking if it's equal to MAX_VEHICLES? Just check if it's a valid vehicle.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)