Help with Entering a bus
#1

I made this under OnPlayerEnterVehicle:
pawn Код:
new BusVeh = GetVehicleModel(vehicleid);
    new String[256];
    new PassengerName[256];
   
    if(BusVeh==437 || BusVeh==431 && GetPlayerState(playerid)==2 && gTeam[playerid]!=1337)
    {
    SendClientMessage(playerid, COLOR_RED, "You must be a bus driver to drive a bus!");
    RemovePlayerFromVehicle(playerid);
    }
    else if(BusVeh==437 || BusVeh==431 && gTeam[playerid]!=1337)
    {
    new BusDriver = GetVehicleDriver(vehicleid);
    if(OnBusDuty[BusDriver]==1)
    {
    GivePlayerMoney(playerid, -5);
    SendClientMessage(playerid, COLOR_GREEN, "You entered the bus for $5");
    GetPlayerName(playerid, PassengerName, sizeof(PassengerName));
    format(String, sizeof(String), "%s has entered your bus!", PassengerName);
    SendClientMessage(BusDriver, COLOR_GREEN, String);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "There is no bus driver that is on duty in this bus!");
    RemovePlayerFromVehicle(playerid);
    }
    }
    return 1;
When I enter the Bus/Coach as driver, without being gTeam 1337 ( LOL )
I won't get removed from the vehicle, Neither will i when i enter as passenger without a valid Bus Driver.
How to fix this?
Thanks, Goz3rr

BTW: I dont get any compile errors or warnings
Reply
#2

RemovePlayerFromVehicle doesn't work:
Quote:
Originally Posted by BeckzyBoi
RemovePlayerFromVehicle - It only shows the 'exit vehicle' animation for the player being removed
I suggest you use SetPlayerPos to teleport player out of the vehicle.
Reply
#3

Is there any other way then teleporting?
And still, I dont see the message
Reply
#4

No, there is no other way, I think.
Reply
#5

Use it under OnPlayerStateChange!
Please correct me if I'm wrong.
But RemovePlayerFromVehicle do work. But other players won't see the animation of the player, that're being removed.
Reply
#6

I'm pretty sure RemovePlayerFromVehicle does work as it should.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)