OnPlayerEnterVehicle being weird?
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
I still do recommend using OnPlayerStateChange, because a player can still abort the entering even after OnPlayerEnterVehicle is called. If this happens, you will end up with a bugged system.
I was "playing" with EnterVehicle and StateChange for like 1 hour until I managed to get it to work with EnterVehicle (I haven't sleep for like 20 hours now), but then I noticed that it will appear even when vehicle is locked :/ but here's another problem: I still need to check if vehicle is locked, and since nothing will run after that I have to use it at the end of EnterVehicle callback, but I have to use it at start since it's the first thing I have to do, so I have to fix "CanEnterVehicle" function somehow

edit: so I commented out everything except that function so I can test it and changed "== 0" to "== 1" so it should sendclientmessage 0 when I CAN enter vehicle

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger == 0)
    {
        if(CanEnterVehicle(playerid, vehicleid) == 1)
        {
            SendClientMessage(playerid, -1, "0");
            //return 1;
        }
        else
            SendClientMessage(playerid, -1, "1");
        //pDriver[playerid] = 1;
    }
    /*FuelTimer[playerid] = SetTimerEx("VehicleFuelUpdate", 15000, 1, "ii", playerid, vehicleid);
    TextDrawSetOutline(tSpeed[playerid], 1);
    TextDrawShowForPlayer(playerid, tSpeed[playerid]);
    new str[32];
    format(str, sizeof(str), "%d l", Fuel[vehicleid]);
    TextDrawSetString(tFuel[playerid], str);
    TextDrawSetOutline(tFuel[playerid], 1);
    TextDrawShowForPlayer(playerid, tFuel[playerid]);
    SpeedTimer[playerid] = SetTimerEx("VehicleUpdate", 400, 1, "ii", playerid, vehicleid);*/

    return 1;
}
nothing happens -.-'
Reply


Messages In This Thread
OnPlayerEnterVehicle being weird? - by SEnergy - 14.08.2012, 11:47
Re: OnPlayerEnterVehicle being weird? - by IceMeteor - 14.08.2012, 11:58
Re: OnPlayerEnterVehicle being weird? - by SEnergy - 14.08.2012, 12:01
Re: OnPlayerEnterVehicle being weird? - by Vince - 14.08.2012, 12:02
Re: OnPlayerEnterVehicle being weird? - by SEnergy - 14.08.2012, 12:04

Forum Jump:


Users browsing this thread: 2 Guest(s)