SA-MP Forums Archive
New cheat? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: New cheat? (/showthread.php?tid=632772)



New cheat? - JR_Junior - 19.04.2017

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
...


Re: New cheat? - ISmokezU - 19.04.2017

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);
}



Re: New cheat? - JR_Junior - 19.04.2017

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!