[Question] Vehicle locks.
#1

Hey everyone,

I just a quick question I got the other day, If I lock a vehicle everyone know that you can exit the vehicle in game, but is it possible to make so a player wont be able to exit a vehicle if the vehicle is locked?

If so under what catecory or how should I create it?

Kind Regards,
Tony
Reply
#2

wondering
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(lock == 1)
    {
       PutPlayerInVehicle(vehicleid);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
wondering
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(lock == 1)
    {
       PutPlayerInVehicle(vehicleid);
    }
    return 1;
}
Sweet, but wont that put the player in the driver seat?
What if the player are exit from the back seat or something?
Reply
#4

PutPlayerInVehicle(playerid,vehicleid,seatid); have seats params aswell

but if player is driver you need to put part where you put player in the vehicle uder OnPlayerStateChange, actualy also passengers can put OnPlayerStateChange, else server still think player is in a car and wont put him back.
Reply
#5

you can just check which seat is the player in

pawn Код:
new Seat = GetPlayerVehicleSeat(playerid);
PutPlayerInVehicle(playerid, vehicleid, Seat);
i think will work
also read this
https://sampwiki.blast.hk/wiki/GetPlayerVehicleSeat
Код:
Note: Sometimes the result can be 128 which is an invalid seat ID. Circumstances of this are not yet known, but it is best to discard information when returned seat number is 128.
Reply
#6

Oh man, Sweet. Thanks alot for the help!

Love people like you who helps out!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)