[Include] OnPlayerWarpToVehicle - Anti Cheat
#1

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:
  • Y-Less - y_hooks
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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

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 ?
Reply
#8

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


Forum Jump:


Users browsing this thread: 3 Guest(s)