Changing player state
#1

I'm tired, bored, and stressed...

I can't think in anything and i'm not leaving it until i do this.

Is there anyway to get the old state and sets a new state for the player? Something like GetPlayerState == PLAYER_STATE_DRIVER and then SetPlayerState == PLAYER_STATE_PASSENGER?

Thanks in advance.
Reply
#2

i'm sure it's possible, try something with onplayerentervehicle, i think there's a setplayerseat function, but i'm not sure
Reply
#3

Yeah yeah, i tryed it before i post. But i need something like when i'm a driver and then when i leave the vehicle i'm automaticly changed to passenger. And i need too something like changing from driver to foot without the removeplayerfromvehicle.
Reply
#4

https://sampwiki.blast.hk/wiki/PutPlayerInVehicle
Reply
#5

About the 1st one i was totaly blind. Thanks. But the one about when player exits the vehicle, is there any way to do it without using RemovePlayerFromVehicle?
Reply
#6

i don't get what you want
Reply
#7

Quote:
Originally Posted by pmk1
i don't get what you want
Is there any way to remove the player from the vehicle without using 'RemovePlayerFromVehicle(playerid);'. I mean, i want exit the vehicle faster than the default way.

Look in here, i'm using this for enter faster in the vehicle:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(IsVehicleOccupied(vehicleid))
    {
        PutPlayerInVehicle(playerid, vehicleid, 1);
    }
    else
    {
        PutPlayerInVehicle(playerid, vehicleid, 0);
    }
    return 1;
}

stock IsVehicleOccupied(vehicleid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 1;
    }
    return 0;
}
Reply
#8

yea it's surely possible, because a few ago i got a bug with a fucked up FS, which made me quit the car without anims, and on the side. lol i just don't know how to do so
Reply
#9

Use GetPlayerPos and SetPlayerPos
Reply
#10

Setting a position wouldn't work if you're changing from driver to passenger.

I've not tried this, but maybe you could try:

pawn Код:
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0); //0 being the seat number.. (0-driver, 1-co-driver, 2&3-passengers)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)