OnPlayerEnterVehicle Help needed
#4

OnPlayerEnterVehicle calls whenever the person hits the button to enter the vehicle, and is close enough to the vehicle. Try setting the players pos. e.g:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new playercar = GetPlayerVehicleID(playerid);
    new newstate = GetPlayerState(playerid);
    new Float:pos[3];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(playercar) == 432)
        {
            if(class[playerid][Mechanic] < 1) return SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        }
        if(GetVehicleModel(playercar) == 520 && GetVehicleModel(playercar) == 425)
        {
            if(class[playerid][Pilot] < 1) return SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        }
    }
    return 1;
}
Reply


Messages In This Thread
OnPlayerEnterVehicle Help needed - by Avi57 - 12.06.2013, 17:24
Re: OnPlayerEnterVehicle Help needed - by feartonyb - 12.06.2013, 17:31
Re: OnPlayerEnterVehicle Help needed - by Avi57 - 13.06.2013, 03:33
Re: OnPlayerEnterVehicle Help needed - by dubyabeast - 13.06.2013, 04:11
Re: OnPlayerEnterVehicle Help needed - by Avi57 - 13.06.2013, 04:15
Re: OnPlayerEnterVehicle Help needed - by yaron0600 - 13.06.2013, 04:27
Re: OnPlayerEnterVehicle Help needed - by Pottus - 13.06.2013, 04:53
Re: OnPlayerEnterVehicle Help needed - by CJay9209 - 13.06.2013, 05:42
Re: OnPlayerEnterVehicle Help needed - by Ballu Miaa - 13.06.2013, 06:01
Re: OnPlayerEnterVehicle Help needed - by Avi57 - 13.06.2013, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)