28.05.2009, 15:16
I made this under OnPlayerEnterVehicle:
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
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;
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