Get a players seat ID
#1

How can I get a players seat ID like
Код:
0-driver, 1-co-driver, 2&3-passengers
I really need this

Thanks,
ArcticFox
Reply
#2

I'm not sure if you can do that.
I know that you can set players seat. https://sampwiki.blast.hk/wiki/PutPlayerInVehicle

Try to create your own function which would get the seat id with help of this one.
Reply
#3

Thanks I think I already have the first idea how to make that
Reply
#4

You could use GetPlayerState for the driver.
Reply
#5

Quote:
Originally Posted by FUNExtreme
You could use GetPlayerState for the driver.
0 Empty (while initializing)
1 Player is on foot
2 Player is driver of a vehicle
3 Player is passenger of a vehicle
7 Player is wasted or on class selection
8 Player is spawned

You can figure who's driver and passenger, but too bad you can't see on which seat is he sitting.
Reply
#6

Quote:
Originally Posted by FUNExtreme
You could use GetPlayerState for the driver.
Yeah thats the driver but what about the passengersin the back seats (2/3)
Reply
#7

I did some fast searching and it seems impossible. I'm not sure
Reply
#8

Quote:
Originally Posted by FUNExtreme
I did some fast searching and it seems impossible. I'm not sure
Why not? If you are using PutPlayerInVehicle it may work.
You can create new function like PutPlayerInVehicleEx in which you could store the seatid you have setted.
Later you can get the stored seatid.
Reply
#9

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by FUNExtreme
I did some fast searching and it seems impossible. I'm not sure
Why not? If you are using PutPlayerInVehicle it may work.
You can create new function like PutPlayerInVehicleEx in which you could store the seatid you have setted.
Later you can get the stored seatid.
Maybe if (strange method xD) when entering a car (hit enter) a menu pops up (stops you from entering the vehicle) and you selected the seat then I can store it where the player selected lather I can use that thanks for the help again

EDIT: How can I stop a player to enter a vehicle after hitting enter?
Reply
#10

pawn Код:
OnPlayerEnterVehicle(blah)
{
    return 0;
}
Or
pawn Код:
OnPlayerStateChange(blah)
{
    if(newstate == PLAYER_STATE_DRIVING)
    {
        RemovePlayerFromVehicle(playerid);
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)