[Help] PutPlayerInVehicle
#1

Hey Everyone, I just made this code to make a player not able to exit a vehicle which are locked or either wearing a seatbelt.

It works perfekt if you are not the driver, but if you are the driver the player are still able to exit the vehicle but the text appers if you are wearing a seatbelt. I've tested alot of stuff, like if the player are a driver which is Seat ID 0 did as well not help to put the player back inside, but the text still appears.

Anyone have any suggestions what the problem might be? or if it's a SA:MP bug?


pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(Seatbelt[playerid] == 1)
    {
        new Seat = GetPlayerVehicleSeat(playerid);
        PutPlayerInVehicle(playerid, vehicleid, Seat);
        SendClientMessage(playerid, COLOR_GRAD1,"   It's kind of hard to exit your vehicle with your seatbelt on, try unbuckle your seatbelt first!");
        return 1;
    }
    if(CarInfo[vehicleid][cLock] == 1 || gCarLock[vehicleid] == 1)
    {
        new Seat = GetPlayerVehicleSeat(playerid);
        PutPlayerInVehicle(playerid, vehicleid, Seat);
        return 1;
    }
    return 1;
}
Reply
#2

just use TogglePlayerControllable(playerid,0);
its make player for can't move and if player in vehicle he can't get out from it if controllable is zero
I hope it will help you
Reply
#3

Use this

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
   
        if(Seatbelt[playerid] == 1)
        {
        ClearAnimations(playerid), PutPlayerInVehicle(playerid, vehicleid, Seat);
         etc......
Reply
#4

Quote:
Originally Posted by telmo_ferreira
Посмотреть сообщение
Use this

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
   
        if(Seatbelt[playerid] == 1)
        {
        ClearAnimations(playerid), PutPlayerInVehicle(playerid, vehicleid, Seat);
         etc......
Thanks alot for the hint, never thought of clearing the animations XD.

Works perfect mate thanks alot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)