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.