SA-MP Forums Archive
[Include] OnPlayerWarpToVehicle - Anti 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] OnPlayerWarpToVehicle - Anti Cheat (/showthread.php?tid=491809)



OnPlayerWarpToVehicle - Anti Cheat - blackeagle1122 - 01.02.2014

Hi,

This callback is called when the player warps to a vehicle with cheats.

How to use:

pawn Код:
#include <a_samp>
#include <OPWTV>//include it into your gamemode
Then,

pawn Код:
public OnPlayerWarpToVehicle(playerid, vehicleid)
{
    return 1;
}
Add this public to your gamemode

Added filterscript support! If you use PutPlayerInVehicle function in your filterscripts,put #include <OPWTV_FS> to your filterscript.

Download!(new and stable)
Pastebin(new and stable)

Download!(old)

Pastebin(old)

Credits:


Re: OnPlayerWarpToVehicle - Anti Cheat - Sublime - 01.02.2014

Give credits to ****** for y_hooks.

Why are you using ALS if you're already using y_hooks? Pardon me if I suck at hooking methods :c


Re: OnPlayerWarpToVehicle - Anti Cheat - blackeagle1122 - 01.02.2014

Quote:
Originally Posted by Sublime
Посмотреть сообщение
Give credits to ****** for y_hooks.

Why are you using ALS if you're already using y_hooks? Pardon me if I suck at hooking methods :c
Because y_hooks is to hooking callbacks. I used ALS to hook a function.


Re: OnPlayerWarpToVehicle - Anti Cheat - Konstantinos - 01.02.2014

If a player gets in a different vehicle as driver over and over again, OnPlayerStateChange will not be called because the state simply will not change.


Re: OnPlayerWarpToVehicle - Anti Cheat - im - 01.02.2014

You should test the code before releasing it.
When a player tries to enter a vehicle, enter[playerid] will be set to 1. And nothing else will be detected after that.
You could use enter[playerid] = vehicleid under OnPlayerEnterVehicle and check for the vehicle in OnPlayerStateChange. Not 100% accurate, though.

Sometimes player get detected when they shouldn't. Sometimes players never get detected. If you teleport from one vehicle to another using cheats (as a driver), OnPlayerStateChange will not get called, because the state does change. You are still a driver, but in a different vehicle.


Re: OnPlayerWarpToVehicle - Anti Cheat - Pottus - 01.02.2014

Another issue with this is by using y_hooks you can't effectively control when this happens in the script so easily. It should actually use ALS hooking method 7 and be placed above any systems that use vehicle code to avoid conflicts.


Re: OnPlayerWarpToVehicle - Anti Cheat - blackeagle1122 - 01.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If a player gets in a different vehicle as driver over and over again, OnPlayerStateChange will not be called because the state simply will not change.
Fixed.

Quote:
Originally Posted by im
Посмотреть сообщение
You should test the code before releasing it.
When a player tries to enter a vehicle, enter[playerid] will be set to 1. And nothing else will be detected after that.
You could use enter[playerid] = vehicleid under OnPlayerEnterVehicle and check for the vehicle in OnPlayerStateChange. Not 100% accurate, though.

Sometimes player get detected when they shouldn't. Sometimes players never get detected. If you teleport from one vehicle to another using cheats (as a driver), OnPlayerStateChange will not get called, because the state does change. You are still a driver, but in a different vehicle.
Fixed

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Another issue with this is by using y_hooks you can't effectively control when this happens in the script so easily. It should actually use ALS hooking method 7 and be placed above any systems that use vehicle code to avoid conflicts.
I don't understand you, what happens if I don't use ALS hooking method ?


Re: OnPlayerWarpToVehicle - Anti Cheat - blackeagle1122 - 01.02.2014

I think i made it %100 accurate, you can check it.