SA-MP Forums Archive
Help with Entering a bus - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Entering a bus (/showthread.php?tid=79445)



Help with Entering a bus - Gozerr - 28.05.2009

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


Re: Help with Entering a bus - SpiderPork - 28.05.2009

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.


Re: Help with Entering a bus - Gozerr - 28.05.2009

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


Re: Help with Entering a bus - SpiderPork - 28.05.2009

No, there is no other way, I think.


Re: Help with Entering a bus - Djiango - 28.05.2009

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.


Re: Help with Entering a bus - lol2112 - 28.05.2009

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