Checking if a player exits a vehicle
#3

Quote:
Originally Posted by ue_falconx
Посмотреть сообщение
Hello mate,

You can also use this for checking if player is exiting a vehicle:-

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid, ispassenger)
{
    SendClientMessage(playerid, -1, "You are going to exit the vehicle.");
    return 1;
}
or for the states, it's better and more accurate on some places:-

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if ((newstate == PLAYER_STATE_ONFOOT) && ((oldstate == PLAYER_STATE_DRIVER) || (oldstate == PLAYER_STATE_PASSENGER))) // your new state is ONFOOT and old state is when he was in the vehicle.
        // your rest of code here
        SendClientMessage(playerid, -1, "you just exited a vehicle.");
    return 1;
}
was just a fast coding, reply down if i have helped you.

-FalconX
This doesn't work, it still allows me to exit the vehicle, OnPlayerExitVehicle doesn't seem to work either.
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)