Checking if a player exits a vehicle
#4

Quote:
Originally Posted by [WSE]Dave
Посмотреть сообщение
This doesn't work, it still allows me to exit the vehicle, OnPlayerExitVehicle doesn't seem to work either.
Please can you tell me what exactly you want?

EDIT:

If you want the player not to exit out of the vehicle you could use the following:-

pawn Код:
// Top in your script
new
    n_szPlayerVehicle[MAX_PLAYERS],
    n_bSeatID[MAX_PLAYERS]
;


// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if ((newstate == PLAYER_STATE_DRIVER) || (newstate == PLAYER_STATE_PASSENGER))
    {
        n_szPlayerVehicle[playerid] = GetPlayerVehicleID(playerid);
        n_bSeatID[playerid] = GetPlayerVehicleSeat(playerid);
    }

    // this stops the player to exit the vehicle.
    if ((newstate == PLAYER_STATE_ONFOOT) && ((oldstate == PLAYER_STATE_DRIVER) || (oldstate == PLAYER_STATE_PASSENGER)))
        PutPlayerInVehicle(playerid, n_szPlayerVehicle[playerid], n_bSeatID[playerid]);
        SendClientMessage(playerid, -1, "You can't exit the vehicle");

    return 1;
}
This should work (not tested btw)... Check maybe ?

-FalconX
Reply


Messages In This Thread
Checking if a player exits a vehicle - by [WSE]Dave - 25.02.2012, 22:27
Re: Checking if a player exits a vehicle - by FalconX - 25.02.2012, 22:37
Re: Checking if a player exits a vehicle - by [WSE]Dave - 25.02.2012, 22:45
Re: Checking if a player exits a vehicle - by FalconX - 25.02.2012, 22:46

Forum Jump:


Users browsing this thread: 1 Guest(s)