[FilterScript] Anti God of Cars
#16

Оставлю тут. Может работать как ФС. Суть АФК бага: на одном транспорте могут ездить несколько игроков.

pawn Code:
#include <a_samp>
new NewWVehicle[MAX_PLAYERS];
new WVehicle[MAX_PLAYERS];
new EnterWVehicleTime[MAX_PLAYERS];
new WVehicleDriver[MAX_VEHICLES];

forward PutPlayerInVehicleEx(playerid, vehicleid, seatid);
public PutPlayerInVehicleEx(playerid, vehicleid, seatid)
{
    //Из-за пинга возможны проблемы. Нужно высадить и лишь потом посадить, если игрок уже был в другом транспорте.
    NewWVehicle[playerid]=vehicleid;
    EnterWVehicleTime[playerid]=0;
    return PutPlayerInVehicle(playerid, vehicleid, seatid);
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
//----------------------        AntiQuikCarChange       ------------------------
    NewWVehicle[playerid]=vehicleid;
    return 1;
}

public OnPlayerUpdate(playerid)
{
//----------------------        AntiQuikCarChange       ------------------------
    new vehicleid=GetPlayerVehicleID(playerid);
    if(vehicleid == 0)WVehicle[playerid]=0; else//exit
    {
        if(WVehicle[playerid] == 0)//enter
        {
            if(NewWVehicle[playerid] != vehicleid)
            {
                SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0);
                Kick(playerid);
                return 0;
            }
            else
            {
                if(GetTickCount()-EnterWVehicleTime[playerid] < 1500)
                {
                    SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0);
                    Kick(playerid);
                    return 0;
                }
                else
                {
                    WVehicle[playerid]=vehicleid;
                    NewWVehicle[playerid]=0;
                    EnterWVehicleTime[playerid]=GetTickCount();
//----------------------        Anti AFK Bug        ----------------------------
                    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)WVehicleDriver[vehicleid]=playerid;
                }
            }
        }
        else if(WVehicle[playerid] != vehicleid)
        {
            SetVehicleVelocity(vehicleid, 0.0, 0.0, 0.0);
            Kick(playerid);
            return 0;
        }
//----------------------        Anti AFK Bug        ----------------------------
        if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER && WVehicleDriver[vehicleid] != playerid)
        {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            SetPlayerPos(playerid, x, y, z);
        }
    }
//...
    return 1;
}
Reply


Messages In This Thread
Anti God of Cars - by Seregamil1 - 29.06.2013, 06:30
Re: Anti God of Cars - by White_116 - 29.06.2013, 07:05
Re: Anti God of Cars - by Seregamil1 - 29.06.2013, 07:18
Re: Anti God of Cars - by Alexander_Petrov - 29.06.2013, 09:11
Re: Anti God of Cars - by Seregamil1 - 29.06.2013, 09:19
Re: Anti God of Cars - by Alexander_Petrov - 29.06.2013, 09:26
Re: Anti God of Cars - by Seregamil1 - 29.06.2013, 09:48
Re: Anti God of Cars - by Jon_De - 29.06.2013, 20:51
Re: Anti God of Cars - by Alexander_Petrov - 29.06.2013, 21:14
Re: Anti God of Cars - by Seregamil1 - 30.06.2013, 03:59
Re: Anti God of Cars - by Jon_De - 30.06.2013, 08:22
Re: Anti God of Cars - by Alexander_Petrov - 30.06.2013, 08:31
Re: Anti God of Cars - by Seregamil1 - 30.06.2013, 08:34
Re: Anti God of Cars - by Alexander_Petrov - 30.06.2013, 08:36
Re: Anti God of Cars - by Seregamil1 - 30.06.2013, 08:50
Re: Anti God of Cars - by White_116 - 30.06.2013, 10:28
Re: Anti God of Cars - by Alexander_Petrov - 30.06.2013, 11:14
Re: Anti God of Cars - by White_116 - 30.06.2013, 12:17
Re: Anti God of Cars - by Alexander_Petrov - 30.06.2013, 16:18
Re: Anti God of Cars - by White_116 - 30.06.2013, 16:23
Re: Anti God of Cars - by 26_RUSSS - 04.07.2013, 11:02
Re: Anti God of Cars - by White_116 - 04.07.2013, 11:20
Re: Anti God of Cars - by AirKite - 08.07.2013, 16:10
Re: Anti God of Cars - by White_116 - 08.07.2013, 16:25
Re: Anti God of Cars - by AirKite - 09.07.2013, 10:13
Re: Anti God of Cars - by White_116 - 09.07.2013, 13:29
Re: Anti God of Cars - by AirKite - 09.07.2013, 20:37
Re: Anti God of Cars - by Size - 25.07.2013, 16:43

Forum Jump:


Users browsing this thread: 4 Guest(s)