Disable exiting a vehicle without TogglePlayerControlable
#1

I want that the player cannot exit the vehicle using the Enter / F key. But i cannot get it done, each time when i return 0 at OnVehicleExit (or whatever the callback is called) it just steps out. I've also tried this but this wouldn't work also:

pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(locked[playerid] == 1)
    {
        if(newkeys == 16) return 0;
    }
    return 1;
}
I just want that he wont be able to exit, but can use everything else like normally. Without TogglePlayerControlable.

Thanks!

Reply
#2

pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
  if (oldstate == PLAYER_STATE_DRIVER)
  {
    PutPlayerInVehicle(playerid, lastVehicle[playerid], 0)
  }
}
something like that?
Reply
#3

Doesn't work too well, anyone got a better solution?
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(newkeys & 16)
    {
        if(locked[playerid])
        {
            return 0;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)