Example #1
0
        public void editvehicle_cmd(Client player)
        {
            Account account = player.GetAccount();

            if (account.AdminLevel < 4)
            {
                return;
            }

            if (!API.IsPlayerInAnyVehicle(player))
            {
                API.SendPictureNotificationToPlayer(player, "You must be in a vehicle to use this command.", "CHAR_BLOCKED", 0, 1, "Server", "~r~Command Error");
                return;
            }

            var veh = VehicleManager.GetVehFromNetHandle(API.GetPlayerVehicle(player));

            if (veh == null)
            {
                API.SendChatMessageToPlayer(player, "~r~Vehicle is null!");
                return;
            }

            if (veh.is_saved() == false)
            {
                API.SendPictureNotificationToPlayer(player, "Only a saved vehicle may be edited.", "CHAR_BLOCKED", 0, 1, "Server", "~r~Command Error");
                return;
            }

            API.SetEntityData(player.handle, "EDIT_VEH", veh);
            API.TriggerClientEvent(player, "show_vehicle_edit_menu", veh.Id, veh.VehModel.ToString(), (veh.OwnerId == 0 ? "NONE" : PlayerManager.Players.Single(x => x.Id == veh.OwnerId).CharacterName), veh.LicensePlate, veh.VehMods[ModdingManager.PrimaryColorId.ToString()], veh.VehMods[ModdingManager.SecondryColorId.ToString()], veh.RespawnDelay.TotalMinutes.ToString("G"), veh.JobId, veh.GroupId);
        }
Example #2
0
        public void ShowStats(Client sender, Client receiver)
        {
            Character character     = receiver.GetCharacter();
            Account   account       = receiver.GetAccount();
            Account   senderAccount = sender.GetAccount();
            var       playerveh     = VehicleManager.GetVehFromNetHandle(NAPI.Player.GetPlayerVehicle(receiver))?.Id.ToString() ?? "None";

            NAPI.Chat.SendChatMessageToPlayer(sender, "==============================================");
            NAPI.Chat.SendChatMessageToPlayer(sender, "Player statistics for " + character.CharacterName);
            NAPI.Chat.SendChatMessageToPlayer(sender, "==============================================");
            NAPI.Chat.SendChatMessageToPlayer(sender, "~g~General:~g~");
            NAPI.Chat.SendChatMessageToPlayer(sender,
                                              $"~h~Character name:~h~ {character.CharacterName} | ~h~ID:~h~ {character.Id} | ~h~Money:~h~ {Money.GetCharacterMoney(character)} | ~h~Bank balance:~h~ {character.BankBalance} | ~h~Playing hours:~h~ {character.GetPlayingHours()}  | ~h~Total hours:~h~ {account.TotalPlayingHours}");

            NAPI.Chat.SendChatMessageToPlayer(sender,
                                              $"~h~Age:~h~ {character.Age} ~h~Birthplace:~h~ {character.Birthplace} ~h~Birthday:~h~ {character.Birthday} ~h~VIP level:~h~ {account.VipLevel} ~h~VIP expires:~h~ {account.VipExpirationDate}");

            NAPI.Chat.SendChatMessageToPlayer(sender, "~b~Faction/Jobs:~b~");
            NAPI.Chat.SendChatMessageToPlayer(sender,
                                              $"~h~Faction ID:~h~ {character.GroupId} ~h~Rank:~h~ {character.GroupRank} ~h~Group name:~h~ {character.Group.Name} ~h~Job 1:~h~ {character.JobOne.Name}");

            NAPI.Chat.SendChatMessageToPlayer(sender, "~r~Property:~r~");
            NAPI.Chat.SendChatMessageToPlayer(sender, $"~h~Owned vehicles:~h~ {character.OwnedVehicles.Count()}");

            if (senderAccount.AdminLevel > 0)
            {
                NAPI.Chat.SendChatMessageToPlayer(sender, "~y~Admin:~y~");
                NAPI.Chat.SendChatMessageToPlayer(sender,
                                                  $"~h~Admin level:~h~ {account.AdminLevel} ~h~Admin name:~h~ {account.AdminName} ~h~Dimension:~h~ {API.GetEntityDimension(receiver)} ~h~Last IP:~h~ {account.LastIp}");
                NAPI.Chat.SendChatMessageToPlayer(sender, $"~h~Current vehicle:~h~{playerveh} ~h~Last vehicle: ~h~ { character?.LastVehicle?.Id}");
                NAPI.Chat.SendChatMessageToPlayer(sender,
                                                  $"~h~Social Club Name:~h~ {account.AccountName} ~h~Admin actions: {account.AdminActions}");
            }
        }
Example #3
0
        public void endtrash_cmd(Client player)
        {
            Character character = player.GetCharacter();

            if (character.JobOne.Type != JobManager.JobTypes.Garbageman)
            {
                player.SendChatMessage("You must be a garbageman to use this command!");
                return;
            }

            if (!character.IsOnGarbageRun)
            {
                player.SendChatMessage("You aren't on a garbage run!");
                return;
            }

            var veh = VehicleManager.GetVehFromNetHandle(API.GetPlayerVehicle(player));

            if (veh?.Job?.Type != JobManager.JobTypes.Garbageman)
            {
                player.SendChatMessage("You must be in your garbage truck to end the garbage run.");
                return;
            }

            character.IsOnGarbageRun = false;
            RespawnGarbageTruck(player, veh);
            character.update_ped();
        }
Example #4
0
        public void setdestination_cmd(Client player)
        {
            if (!NAPI.Player.IsPlayerInAnyVehicle(player))
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be inside a taxi to use this command.", "CHAR_BLOCKED", 0, 1, "Server", "~r~Command Error");
                return;
            }

            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(NAPI.Player.GetPlayerVehicle(player));

            if (veh.Driver.TaxiPassenger != character)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You are not inside a taxi which has accepted your ride request.", "CHAR_BLOCKED", 0, 1, "Server", "~r~Command Error");
                return;
            }

            NAPI.ClientEvent.TriggerClientEvent(player, "get_waypoint_position");

            character.TaxiStart = character.Client.Position;

            character.TaxiTimer = new Timer {
                Interval = 2000
            };
            character.TaxiTimer.Elapsed += delegate { TaxiMeterTimer(character); };
            character.TaxiTimer.Start();
        }
Example #5
0
        public void OnPlayerExitVehicle(Client player, Vehicle vehicle)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(vehicle);

            if (character == null)
            {
                return;
            }

            if (veh != null)
            {
                if (OnDutyDrivers.Contains(character) && veh.Job.Type == JobManager.JobTypes.Taxi)
                {
                    NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] You have left your taxi. Please return to it within 60 seconds or you will be taken off-duty and it will respawn.");

                    veh.CustomRespawnTimer = new Timer {
                        Interval = 1000 * 60
                    };
                    veh.CustomRespawnTimer.Elapsed += delegate { RespawnTaxi(character, veh); };
                    veh.CustomRespawnTimer.Start();
                }

                if (veh.Driver != null && character.TaxiDriver != null)
                {
                    if (veh.Driver == character.TaxiDriver)
                    {
                        InventoryManager.GiveInventoryItem(veh.Driver, new Money(), character.TotalFare);
                        InventoryManager.DeleteInventoryItem(character, typeof(Money), character.TotalFare);

                        veh.Driver.Save();
                        character.Save();

                        NAPI.Chat.SendChatMessageToPlayer(player, "~y~[TAXI] You have been charged $" + character.TotalFare + " for your taxi ride.");
                        NAPI.Chat.SendChatMessageToPlayer(veh.Driver.Client, "~y~[TAXI] You have been paid $" + character.TotalFare + " for your services.");

                        NAPI.ClientEvent.TriggerClientEvent(player, "update_fare_display", 0, 0, "");
                        NAPI.ClientEvent.TriggerClientEvent(veh.Driver.Client, "update_fare_display", 0, 0, "");

                        LogManager.Log(LogManager.LogTypes.Stats, $"[Job] {veh.Driver.CharacterName}[{veh.Driver.Client.GetAccount().AccountName}] has earned ${character.TotalFare} from a taxi fare. (Fare: {character.CharacterName})");
                        LogManager.Log(LogManager.LogTypes.Stats, $"[Job] {character.CharacterName}[{player.GetAccount().AccountName}] has paided ${character.TotalFare} for a taxi fare. (Driver: {veh.Driver.CharacterName})");

                        veh.Driver.TaxiPassenger = null;
                        character.TaxiDriver     = null;
                        character.TaxiTimer.Stop();
                        character.TotalFare = 0;
                    }
                }
            }
        }
Example #6
0
        private void API_onPlayerEnterVehicle(Client player, NetHandle vehicle, int seat)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(vehicle);

            if (veh?.JobId != 0)
            {
                if (seat == -1 && veh?.JobId != 0 && veh?.JobId != character.JobOneId && player.GetAccount().AdminDuty == false)
                {
                    API.SendPictureNotificationToPlayer(player, "This vehicle is only available to " + veh?.Job?.Name, "CHAR_BLOCKED", 0, 1, "Server", "~r~Vehicle Locked");
                    API.Delay(1000, true, () => API.WarpPlayerOutOfVehicle(player));;
                }
            }
        }
Example #7
0
        public void taxiduty_cmd(Client player)
        {
            Character character = player.GetCharacter();

            if (character.JobOne.Type != JobManager.JobTypes.Taxi)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be a taxi driver to use this command.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (!NAPI.Player.IsPlayerInAnyVehicle(player))
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be in a taxi to use this command.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (NAPI.Player.GetPlayerVehicleSeat(player) != -1)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be in the driver seat of a taxi to use this command.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            var veh = VehicleManager.GetVehFromNetHandle(NAPI.Player.GetPlayerVehicle(player));

            if (veh.Job == null)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be driving a taxi car to go on taxi duty.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (veh.Job.Type != JobManager.JobTypes.Taxi)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be driving a taxi car to go on taxi duty.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (!OnDutyDrivers.Contains(character))
            {
                character.TaxiDuty = true;
                SendMessageToOnDutyDrivers(character.rp_name() + " is now on taxi duty.");
                NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] You are now on taxi duty. If you leave your vehicle you will be taken off duty automatically.");
            }
            else
            {
                character.TaxiDuty = false;
                SendMessageToOnDutyDrivers(character.rp_name() + " has gone off of taxi duty.");
                NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] You have gone off of taxi duty.");
            }
        }
Example #8
0
        public void OnPlayerEnterVehicle(Player player, Vehicle vehicle, sbyte seat)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(vehicle);

            if (veh?.JobId != 0)
            {
                if (seat == 0 && veh?.JobId != 0 && veh?.JobId != character.JobOneId && player.GetAccount().AdminDuty == false)
                {
                    NAPI.Notification.SendPictureNotificationToPlayer(player, "This vehicle is only available to " + veh?.Job?.Name, "CHAR_BLOCKED", 0, 1, "Server", "~r~Vehicle Locked");
                    //API.Delay(1000, true, () => NAPI.Player.WarpPlayerOutOfVehicle(player));
                    Task.Delay(1000).ContinueWith(t => NAPI.Player.WarpPlayerOutOfVehicle(player)); // TODO: delay fixme
                }
            }
        }
Example #9
0
        public void fixcar_cmd(Player player)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(NAPI.Player.GetPlayerVehicle(player));

            if (veh == null)
            {
                return;
            }

            if (character?.JobOne?.Type != JobManager.JobTypes.Mechanic)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be a mechanic to use this command.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (veh == null)
            {
                NAPI.Chat.SendChatMessageToPlayer(player, "You must be inside of the vehicle to fix it.");
                return;
            }

            if (NAPI.Vehicle.GetVehicleEngineStatus(veh.Entity) == true)
            {
                player.SendChatMessage("You must turn the engine off before fixing it.");
                return;
            }

            if (TimeManager.GetTimeStamp < character.FixcarPrevention)
            {
                NAPI.Chat.SendChatMessageToPlayer(player, $@"You must wait {character.FixcarPrevention - TimeManager.GetTimeStamp} more seconds before fixing another car.");
                return;
            }


            if (InventoryManager.DoesInventoryHaveItem(character, typeof(EngineParts)).Length == 0)
            {
                player.SendChatMessage("You don't have enough engine parts.");
                return;
            }

            NAPI.Vehicle.SetVehicleHealth(veh.Entity, 1000);
            NAPI.Vehicle.RepairVehicle(veh.Entity);
            InventoryManager.DeleteInventoryItem(character, typeof(EngineParts), 1);
            player.SendChatMessage("Vehicle repaired.");
            LogManager.Log(LogManager.LogTypes.Stats, $"[Vehicle] {character.CharacterName}[{player.GetAccount().AccountName}] has fixed vehicle #{veh.Id}.");
            character.FixcarPrevention = TimeManager.GetTimeStampPlus(TimeSpan.FromSeconds(10));
        }
Example #10
0
File: MDC.cs Project: Yarpii/MTGRP
        public void mdc_cmd(Client player)
        {
            var character = player.GetCharacter();

            if (character.Group == Group.None || character.Group.CommandType != Group.CommandTypeLspd)
            {
                NAPI.Chat.SendChatMessageToPlayer(player, core.Color.White, "You must be in the LSPD to use this command.");
                return;
            }

            var vehHandle = NAPI.Player.GetPlayerVehicle(player);
            var veh       = VehicleManager.GetVehFromNetHandle(vehHandle);

            if (veh.Group.CommandType != Group.CommandTypeLspd)
            {
                NAPI.Chat.SendChatMessageToPlayer(player, core.Color.White, "This vehicle is not equipped with a Mobile Database Computer.");
                return;
            }

            if (NAPI.Player.GetPlayerVehicleSeat(player) != -1 && NAPI.Player.GetPlayerVehicleSeat(player) != 0)
            {
                NAPI.Chat.SendChatMessageToPlayer(player, core.Color.White, "You can only access the Mobile Database Computer from the front seats.");
                return;
            }

            if (character.IsViewingMdc)
            {
                API.Shared.TriggerClientEvent(character.Client, "hideMDC");
                ChatManager.RoleplayMessage(character, "logs off of the MDC.", ChatManager.RoleplayMe);
                character.IsViewingMdc = false;
            }
            else
            {
                API.Shared.TriggerClientEvent(character.Client, "showMDC");
                ChatManager.RoleplayMessage(character, "logs into the MDC.", ChatManager.RoleplayMe);
                character.IsViewingMdc = true;
            }
        }
Example #11
0
        public void paintcar_cmd(Player player, int col1, int col2)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(NAPI.Player.GetPlayerVehicle(player));

            if (veh == null)
            {
                return;
            }

            if (character?.JobOne?.Type != JobManager.JobTypes.Mechanic)
            {
                NAPI.Notification.SendPictureNotificationToPlayer(player, "You must be a mechanic to use this command.", "CHAR_BLOCKED", 0, 0, "Server", "~r~Command Error");
                return;
            }

            if (InventoryManager.DoesInventoryHaveItem(character, typeof(SprayPaint)).Length == 0)
            {
                player.SendChatMessage("You don't have spray paint.");
                return;
            }

            if (NAPI.Vehicle.GetVehicleEngineStatus(veh.Entity) == true)
            {
                player.SendChatMessage("You must turn the engine off before painting it.");
                return;
            }

            NAPI.Vehicle.SetVehiclePrimaryColor(NAPI.Player.GetPlayerVehicle(player), col1);
            NAPI.Vehicle.SetVehicleSecondaryColor(NAPI.Player.GetPlayerVehicle(player), col2);
            veh.VehMods[ModdingManager.PrimaryColorId.ToString()]  = col1.ToString();
            veh.VehMods[ModdingManager.SecondryColorId.ToString()] = col2.ToString();
            veh.Save();
            InventoryManager.DeleteInventoryItem(character, typeof(SprayPaint), 1);
            player.SendChatMessage("Vehicle painted.");

            LogManager.Log(LogManager.LogTypes.Stats, $"[Vehicle] {character.CharacterName}[{player.GetAccount().AccountName}] has painted vehicle #{veh.Id}.");
        }
Example #12
0
        public void choppercam_cmd(Client player)
        {
            Character character = player.GetCharacter();

            if (character.Group == Group.None || character.Group.CommandType != Group.CommandTypeLsnn)
            {
                API.SendChatMessageToPlayer(player, Color.White, "You must be a member of the LSNN to use that command.");
                return;
            }

            var vehicleHandle = API.GetPlayerVehicle(player);
            var veh           = VehicleManager.GetVehFromNetHandle(vehicleHandle);

            if (character.Group.Id != veh.GroupId && veh.VehModel != VehicleHash.Maverick)
            {
                API.SendChatMessageToPlayer(player, "You must be in an LSNN chopper to use the chopper camera.");
                return;
            }

            if (CameraSet == true && ChopperCamToggle == false)
            {
                API.SendChatMessageToPlayer(player, "A camera has already been set. /pickupcamera before using the chopper cam.");
                return;
            }

            if (ChopperCamToggle == true)
            {
                if (IsBroadcasting == true)
                {
                    foreach (var c in API.GetAllPlayers())
                    {
                        if (c == null)
                        {
                            continue;
                        }

                        Character receivercharacter = c.GetCharacter();
                        if (receivercharacter == null)
                        {
                            continue;
                        }

                        if (receivercharacter.IsWatchingBroadcast)
                        {
                            API.TriggerClientEvent(c, "unwatch_broadcast");
                            receivercharacter.IsWatchingBroadcast = false;
                            API.SendChatMessageToPlayer(c, "~p~The LSNN camera has been turned off.");
                        }
                    }
                }

                API.SendNotificationToPlayer(player, "The chopper camera has been turned ~r~off~w~.");
                ChatManager.NearbyMessage(player, 10, "~p~" + character.rp_name() + " has turned off the chopper cam.");
                CameraPosition   = null;
                CameraRotation   = null;
                CameraSet        = false;
                ChopperCamToggle = false;
                ChopperRotation.Stop();
                return;
            }

            CameraSet        = true;
            ChopperCamToggle = true;
            Chopper          = API.GetPlayerVehicle(player);
            CameraPosition   = API.GetEntityPosition(Chopper) - new Vector3(0, 0, 3);
            CameraRotation   = API.GetEntityRotation(Chopper);
            API.SendNotificationToPlayer(player, "The chopper camera has been turned ~b~on~w~.");
            ChatManager.NearbyMessage(player, 10, "~p~" + character.rp_name() + " has turned on the chopper cam.");
            ChopperRotation = new Timer {
                Interval = 3000
            };
            ChopperRotation.Elapsed += delegate { UpdateChopperRotation(player); };
            ChopperRotation.Start();
        }
Example #13
0
        private void API_onPlayerEnterVehicle(Client player, NetHandle vehicle, int seat)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(vehicle);

            if (veh?.Job?.Type == JobManager.JobTypes.Garbageman && character.JobOne?.Type == JobManager.JobTypes.Garbageman)
            {
                Property targetProperty = null;
                int      maxGarbage     = 0;
                foreach (var prop in PropertyManager.Properties)
                {
                    if (prop.HasGarbagePoint)
                    {
                        if (prop.GarbageBags > maxGarbage)
                        {
                            maxGarbage     = prop.GarbageBags;
                            targetProperty = prop;
                        }
                    }
                }

                if (maxGarbage == 0)
                {
                    int GarbageProperties = 0;
                    foreach (var p in PropertyManager.Properties)
                    {
                        if (p.HasGarbagePoint)
                        {
                            GarbageProperties++;
                        }
                    }

                    if (GarbageProperties == PropertyManager.Properties.Count)
                    {
                        player.SendChatMessage("There is no garbage to pick up!");
                        player.warpOutOfVehicle();
                        return;
                    }

                    targetProperty = ChooseRandomProperty();

                    while (!targetProperty.HasGarbagePoint)
                    {
                        targetProperty = ChooseRandomProperty();
                    }

                    targetProperty.GarbageBags = 5;
                }

                if (veh.GarbageBags == 10)
                {
                    API.TriggerClientEvent(player, "garbage_setwaypoint", character.JobOne.MiscOne.Location);
                    player.SendChatMessage("You've got 10 bags of garbage in this truck. Unload it at the waypoint on your map.");
                }
                else
                {
                    API.TriggerClientEvent(player, "garbage_setwaypoint", targetProperty.GarbagePoint);
                    player.SendChatMessage("A garbage waypoint has been set on your map.");
                }

                if (!character.IsOnGarbageRun)
                {
                    character.IsOnGarbageRun = true;
                    player.SendChatMessage("~r~You have 15 minutes to pick up the trash!");
                    character.GarbageTimeLeft      = 900000;
                    character.GarbageTimeLeftTimer = new Timer {
                        Interval = 1000
                    };
                    character.GarbageTimeLeftTimer.Elapsed += delegate { UpdateTimer(player); };
                    character.GarbageTimeLeftTimer.Start();
                    character.update_ped();
                    veh.CustomRespawnTimer = new Timer {
                        Interval = 900000
                    };
                    veh.CustomRespawnTimer.Elapsed += delegate { RespawnGarbageTruck(player, veh); };
                    veh.CustomRespawnTimer.Start();
                }
            }
        }
Example #14
0
        public void OnPlayerEnterVehicle(Client player, Vehicle vehicle, sbyte seat)
        {
            Character character = player.GetCharacter();
            var       veh       = VehicleManager.GetVehFromNetHandle(vehicle);

            if (veh == null)
            {
                return;
            }

            //Cancel taxi car respawn
            if (OnDutyDrivers.Contains(character) && veh.Job.Type == JobManager.JobTypes.Taxi)
            {
                if (veh.CustomRespawnTimer.Enabled && seat == 0)
                {
                    NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] You have returned to your taxi and will no longer be taken off-duty.");
                    veh.CustomRespawnTimer.Stop();
                }
            }

            //Check for passengers entering available cabs
            if (seat != 0)
            {
                if (veh.Job?.Type == JobManager.JobTypes.Taxi)
                {
                    if (veh.Driver.Client == player)
                    {
                        player.SendChatMessage("You cannot enter your own taxi.");
                        API.WarpPlayerOutOfVehicle(player);
                        return;
                    }
                    if (veh.Driver == null)
                    {
                        NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] This taxi currently has no driver.");
                        //API.Delay(1000, true, () => API.WarpPlayerOutOfVehicle(player));
                        Task.Delay(1000).ContinueWith(t => API.WarpPlayerOutOfVehicle(player)); // CONV NOTE: delay fixme
                        return;
                    }

                    if (veh.Driver.TaxiPassenger == null && OnDutyDrivers.Contains(veh.Driver) && TaxiRequests.Contains(character))
                    {
                        /*if (!taxi_requests.Contains(character))
                         * {
                         *  NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] You must have an active taxi request to ride in a taxi. ( /requesttaxi )");
                         *  API.Delay(1000, true, () => API.WarpPlayerOutOfVehicle(player));;
                         *  return;
                         * }
                         *
                         * if (veh.driver.taxi_passenger != null)
                         * {
                         *  NAPI.Chat.SendChatMessageToPlayer(player, Color.Yellow, "[TAXI] This driver already has an active fare.");
                         *  return;
                         * }*/


                        veh.Driver.TaxiPassenger = character;
                        character.TaxiDriver     = veh.Driver;
                        TaxiRequests.Remove(character);

                        TaxiPictureNotification(player, veh.Driver.rp_name() + " has accepted your taxi request.", subject: "~y~Request Accepted");
                        player.SendChatMessage(veh.Driver.rp_name() + " has accepted your taxi request.");
                        SendMessageToOnDutyDrivers(veh.Driver.rp_name() + " has accepted " + character.rp_name() + "'s taxi request.");
                        NAPI.Chat.SendChatMessageToPlayer(player, "[TAXI] Please set a destination on your map and then type: /setdestination");
                        player.SendChatMessage("[TAXI] Please set a destination on your map and then type: /setdestination");

                        NAPI.ClientEvent.TriggerClientEvent(player, "update_fare_display", veh.Driver.TaxiFare, 0, "");
                        NAPI.ClientEvent.TriggerClientEvent(veh.Driver.Client, "update_fare_display", veh.Driver.TaxiFare, 0, "");
                    }
                    else if (veh.Driver.TaxiPassenger == character)
                    {
                        NAPI.ClientEvent.TriggerClientEvent(player, "update_fare_display", veh.Driver.TaxiFare, 0, "");
                        NAPI.ClientEvent.TriggerClientEvent(veh.Driver.Client, "update_fare_display", veh.Driver.TaxiFare, 0, "");

                        NAPI.Chat.SendChatMessageToPlayer(player, "[TAXI] Please set a destination on your map and then type: /setdestination");
                    }
                }
            }
        }