Anti Car-Warping is not working as it should
#9

This code looks better in my opinion. When player warps a vehicle OnPlayerEnterVehicle is not called. So put a variable which says that OnPlayerEnterVehicle is called.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    SetPVarInt(playerid, "CurrentVehicle", vehicleid);
    return 1;
}
And when OPSC is called, check if player's current vehicle matches the variable we set in OPEV.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2 || newstate == 3)
    {
        if(GetPVarInt(playerid, "CurrentVehicle") != GetPlayerVehicleID(playerid))
        {
            Kick(playerid);
        }
    }
    return 1;
}
Sorry for my english.
Reply


Messages In This Thread
Deleted. - by iFiras - 12.06.2014, 15:10
Deleted. - by iFiras - 13.06.2014, 11:39
Re: Anti Car-Warping is not working as it should - by MacT - 13.06.2014, 12:03
Re: Anti Car-Warping is not working as it should - by Sojo12 - 13.06.2014, 12:34
Re: Anti Car-Warping is not working as it should - by MacT - 13.06.2014, 12:39
Re: Anti Car-Warping is not working as it should - by Sojo12 - 13.06.2014, 12:45
Re: Anti Car-Warping is not working as it should - by MacT - 13.06.2014, 12:52
Deleted. - by iFiras - 15.06.2014, 11:05
Re: Anti Car-Warping is not working as it should - by Yera96 - 15.06.2014, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)