Anti Vehicle-Repair.
#1

Hey, i started to develop an anti-cheat.
In Anti-Health hack i used with OnPlayerTakeDamage to check if play fallen, Get heat or something else,
but i cant do it in vehicle.
I can make a check if player shooting, has i did. But if player crash into a wall?

Don't tell me about OnVehicleDamageStatusUpdate because this public not called in VEHICLE HEALTH CHANGES.
And don't tell me to do timer, because it just don't work.

Help?
Reply
#2

UP..
Reply
#3

OnVehicleDamageStatusUpdate and try to use GetVehicleHealth(vehicleid, &Float:health);
Reply
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
OnVehicleDamageStatusUpdate and try to use GetVehicleHealth(vehicleid, &Float:health);
Do even read what i wrote? I SAID THAT OnVehicleDamageStatusUpdate This does not include vehicle health changes
Reply
#5

Timers work. The Only Way Is Timer - TOWIT
Reply
#6

or OnPlayerUpdate
Reply
#7

Quote:
Originally Posted by Jefff
Посмотреть сообщение
or OnPlayerUpdate
And what should i made over there? It's not even close to what i need.
I need a public that has a same work of OnPlayerTakeDamage but for vehicle. So i can detect on player crash to something or something else.

Quote:
Originally Posted by Hanger
Посмотреть сообщение
Timers work. The Only Way Is Timer - TOWIT
And what i'll do in this timer?
Reply
#8

Example

pawn Код:
new Float:vHealth[MAX_VEHICLES];
new OneSecond[MAX_PLAYERS];
OnPlayerUpdate

pawn Код:
static timee, ID;

timee = gettime();

if(OneSecond[playerid] < timee)
{
    OneSecond[playerid] = timee;
    ID = GetPlayerVehicleID(playerid);
    if(ID)
    {
        static Float:vHP;
        GetVehicleHealth(ID, vHP);
        if(vHP != vHealth[ID])
        {
            vHealth[ID] = vHP;
            // health changes
        }
    }
}
Reply
#9

This would work if you had a gas station script that checks if you're near a gas station, check if the value is suddenly 100/1000 and check if he's at a gas station or not. If not, ban the player.
Reply
#10

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
This would work if you had a gas station script that checks if you're near a gas station, check if the value is suddenly 100/1000 and check if he's at a gas station or not. If not, ban the player.
Quote:
Originally Posted by Jefff
Посмотреть сообщение
Example

pawn Код:
new Float:vHealth[MAX_VEHICLES];
new OneSecond[MAX_PLAYERS];
OnPlayerUpdate

pawn Код:
static timee, ID;

timee = gettime();

if(OneSecond[playerid] < timee)
{
    OneSecond[playerid] = timee;
    ID = GetPlayerVehicleID(playerid);
    if(ID)
    {
        static Float:vHP;
        GetVehicleHealth(ID, vHP);
        if(vHP != vHealth[ID])
        {
            vHealth[ID] = vHP;
            // health changes
        }
    }
}
Those ways doesn't work.
The code you gave is to detect when health changed, but not if it become from crash, or fix or something else.
AGAIN, I need something like OnPlayerTakeDamage, for vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)