PutPlayerInVehicle (Not working if seat = 0)
#1

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(LastCar[playerid] == 1 || Seatbelt[playerid] == true)
    {
        new string[125];
        format(string,sizeof(string),"* %s tries to exit the vehicle but the seatbelt is on.",sendername(playerid));
        SetPlayerChatBubble(playerid,string,PURPLE,10,5000);
        MSG(playerid,COLOR_RED,"SERVER: Unbuckle your seatbelt to exit the vehicle.");
        PutPlayerInVehicle(playerid,LastCar[playerid],GetPlayerVehicleSeat(playerid));
        printf("Seat: %i Car: %i",GetPlayerVehicleSeat(playerid),LastCar[playerid]);

    }
        return 1;
}
Title says it all if the player is in the seat id 0 (AKA: Driver) he wont be set back in the vehicle. Other seats working fine.


Thanks.
Reply
#2

try this -

Quote:

PutPlayerInVehicle(playerid,LastCar[playerid],GetPlayerVehicleSeat(playerid));

change the above to the following --
Quote:

PutPlayerInVehicle(playerid,vehicleid,GetPlayerVehicleSeat(playerid));

Reply
#3

That doesn't change anything because Lastcar = VEhicleid
Reply
#4

does it send any message when player exits vehicle as driver?
Reply
#5

Yes it does.
And debug:
Seat: 0.
Car: 3.
Reply
#6

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(LastCar[playerid] == 1 || Seatbelt[playerid] == true)
    {
        new string[125];
        format(string,sizeof(string),"* %s tries to exit the vehicle but the seatbelt is on.",sendername(playerid));
        SetPlayerChatBubble(playerid,string,PURPLE,10,5000);
        MSG(playerid,COLOR_RED,"SERVER: Unbuckle your seatbelt to exit the vehicle.");
        PutPlayerInVehicle(playerid,LastCar[playerid],GetPlayerVehicleSeat(playerid));
        printf("Seat: %i Car: %i",GetPlayerVehicleSeat(playerid),LastCar[playerid]);
        return 0;
    }
        return 1;
}
try
Reply
#7

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(LastCar[playerid] == 1 || Seatbelt[playerid] == true)
    {
        new string[125];
        format(string,sizeof(string),"* %s tries to exit the vehicle but the seatbelt is on.",sendername(playerid));
        SetPlayerChatBubble(playerid,string,PURPLE,10,5000);
        MSG(playerid,COLOR_RED,"SERVER: Unbuckle your seatbelt to exit the vehicle.");
        PutPlayerInVehicle(playerid,LastCar[playerid],GetPlayerVehicleSeat(playerid));
        printf("Seat: %i Car: %i",GetPlayerVehicleSeat(playerid),LastCar[playerid]);
        return 0;
    }
        return 1;
}
try
Quote:

Return Values:
This callback does not handle returns.

https://sampwiki.blast.hk/wiki/OnPlayerExitVehicle
Reply
#8

oh ok so no other way then getting veh id and putting player again in it
Reply
#9

There is no problem in getting the car id or the seat id it works but the thing is if seat == 0 then he wont be set back in the seat should I try making a timer of 2 secs? then put him in or not?
Reply
#10

hmm well try add an stock for putting player in vehicle and add it because i think it will be enough time the player tried to get out and is again in it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)