示例#1
0
        public void RepairMarker2(Client client)
        {
            ColShape colShape = NAPI.ColShape.CreateCylinderColShape(new Vector3(111.7056, 6625.828, 31.40783), 3, 4);
            Marker   repair2  = NAPI.Marker.CreateMarker(0, new Vector3(111.7056, 6625.828, 31.40783), new Vector3(), new Vector3(0, 0, 6.967081), 1, new Color(16, 78, 139, 100));

            colShape.SetData("repair2", repair2);
        }
示例#2
0
        public void Create()
        {
            Marker = API.shared.createMarker(1, Position - new Vector3(0.0, 0.0, 1.0), new Vector3(), new Vector3(), new Vector3(1.0, 1.0, 0.5), 150, 64, 196, 255);

            ColShape = API.shared.createCylinderColShape(Position, 0.85f, 0.85f);
            ColShape.onEntityEnterColShape += (s, ent) =>
            {
                Client player;

                if ((player = API.shared.getPlayerFromHandle(ent)) != null)
                {
                    player.triggerEvent("ShowHouseText", 2);
                }
            };

            ColShape.onEntityExitColShape += (s, ent) =>
            {
                Client player;

                if ((player = API.shared.getPlayerFromHandle(ent)) != null)
                {
                    player.triggerEvent("ShowHouseText", 0);
                }
            };

            Label = API.shared.createTextLabel("Leave House", Position, 10f, 0.65f);
        }
示例#3
0
        private void API_onEntityExitColShape(ColShape colshape, NetHandle entity)
        {
            if (API.GetEntityType(entity) == EntityType.Player && colshape.hasData("property_entrance"))
            {
                if (API.GetEntityData(entity, "at_interance_property_id") == colshape.getData("property_entrance"))
                {
                    API.ResetEntityData(entity, "at_interance_property_id");
                }
            }

            if (API.GetEntityType(entity) == EntityType.Player && colshape.hasData("property_interaction"))
            {
                if (API.GetEntityData(entity, "at_interaction_property_id") == colshape.getData("property_interaction"))
                {
                    API.ResetEntityData(entity, "at_interaction_property_id");
                }
            }

            if (API.GetEntityType(entity) == EntityType.Player && colshape.hasData("property_garbage"))
            {
                if (API.GetEntityData(entity, "at_garbage_property_id") == colshape.getData("property_garbage"))
                {
                    API.ResetEntityData(entity, "at_garbage_property_id");
                }
            }

            if (API.GetEntityType(entity) == EntityType.Player && colshape.hasData("property_exit"))
            {
                if (API.GetEntityData(entity, "at_exit_property_id") == colshape.getData("property_exit"))
                {
                    API.ResetEntityData(entity, "at_exit_property_id");
                }
            }
        }
示例#4
0
        public void Business_EnterColShape(ColShape shape, Client player)
        {
            //var business = shape.GetExternalData<Data.Entities.Business>(0);
            if (!shape.HasData("BUSINESS_CLASS"))
            {
                return;
            }
            Data.Entities.Business business = shape.GetData("BUSINESS_CLASS");

            //var user = player.GetExternalData<Data.Entities.User>(0);
            if (!player.HasData("USER_CLASS"))
            {
                return;
            }
            Data.Entities.User user = player.GetData("USER_CLASS");

            if (business != null)
            {
                if (business.owner == 0)
                {
                    player.TriggerEvent("displayBusinessVenta");
                }
                else
                {
                    if (business.type == 6 || business.type == 7 || business.type == 8)
                    {
                        player.TriggerEvent("adviceBuyVehicle");
                    }
                }

                user.isInBusiness = true;
                user.business     = business;
            }
        }
示例#5
0
        public void ATMHit(ColShape colshape, NetHandle entity)
        {
            if (colshape.getData("ATM") == true)
            {
                var sender = API.getPlayerFromHandle(entity);
                if (sender == null)
                {
                    return;
                }

                object[] argumentList = new object[13];
                argumentList[0] = ATM_ROOT;
                argumentList[1] = "ATM";
                argumentList[2] = "Select option:";
                argumentList[3] = false;
                argumentList[4] = 4;
                argumentList[5] = "Balance";
                argumentList[6] = "Withdraw";
                argumentList[7] = "Deposit";
                argumentList[8] = "Transfer";
                for (var i = 0; i < 4; i++)
                {
                    argumentList[9 + i] = "";
                }
                API.triggerClientEvent(sender, "menu_handler_create_menu", argumentList);
            }
        }
示例#6
0
        private void ColShapeTriggerExit(ColShape colshape, NetHandle entity)
        {
            var player = API.getPlayerFromHandle(entity);

            if (player == null)
            {
                return;
            }

            if (colshape != null && colshape.getData("IS_ATM_TRIGGER") == true)
            {
                var id        = colshape.getData("ATM_ID");
                var type      = colshape.getData("ATM_TYPE");
                var amount    = colshape.getData("ATM_AMOUNT");
                var newamount = player.getData("IN_ATM_AMOUNT");
                var info      = colshape.getData("ATM_INFO");
                colshape.setData("ATM_AMOUNT", newamount);
                player.setData("IN_ATM_COLSHAPE", null);
                player.setData("IN_ATM", null);
                player.setData("IN_ATM_TYPE", null);
                player.setData("IN_ATM_ID", null);
                player.setData("IN_ATM_BLIP", null);
                player.setData("IN_ATM_MARKER", null);
                player.setData("IN_ATM_TEXT", null);
                API.shared.triggerClientEvent(player, "Menu_StoreClose");
            }
        }
示例#7
0
 private void OnEntityEnterColShape(ColShape colshape, NetHandle entity)
 {
     if (API.getEntityType(entity) != EntityType.Player)
     {
         return;
     }
     foreach (GasStation gs in GasStation.GasStations)
     {
         if (gs.RefillArea1 != colshape && gs.RefillArea2 != colshape)
         {
             continue;
         }
         Client player = API.getPlayerFromHandle(entity);
         if (!player.isInVehicle)
         {
             return;
         }
         if (player.vehicleSeat != -1)
         {
             return;
         }
         API.triggerClientEvent(player, "OnEnterGasStation");
         Player.PlayerData[player].HasEnteredGasStation = gs.Id;
     }
 }
示例#8
0
        private void createTrigger()
        {
            bankTrigger = API.createCylinderColShape(bankTriggerPos, 1f, 3f);
            API.createMarker(1, bankTriggerPos, new Vector3(), new Vector3(),
                             new Vector3(1f, 1f, 1f), 255, 33, 108, 24);

            var blip = API.createBlip(bankTriggerPos);

            blip.name       = bankName;
            blip.sprite     = 108;
            blip.shortRange = true;

            bankTrigger.onEntityEnterColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.sendChatMessageToPlayer(player, "~g~[~o~Teller~g~]:~w~ Hello! How can I help you?");
                    API.sendNotificationToPlayer(player, "Press ~b~F~w~ to use the bank.");
                    API.triggerClientEvent(player, "npcbiz:triggerEnter", "bank", bankName);
                }
            };

            bankTrigger.onEntityExitColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.triggerClientEvent(player, "npcbiz:triggerExit", "bank", bankName);
                }
            };
        }
示例#9
0
        private void npcTriggers()
        {
            var ped = API.createPed(API.pedNameToModel("CarBuyerCutscene"), npcPos, 113f);

            API.playPedScenario(ped, "WORLD_HUMAN_SMOKING");

            var blip = API.createBlip(npcPos);

            blip.name       = "Vapid Lot (Mid-level Cars)";
            blip.sprite     = 225;
            blip.color      = 5;
            blip.shortRange = true;

            var      shopTriggerPos = new Vector3(-143.4823f, -1172.609f, 24.20414f);
            ColShape shopBubble     = API.createSphereColShape(npcPos, 3f);

            API.createMarker(1, shopTriggerPos, new Vector3(), new Vector3(),
                             new Vector3(1f, 1f, 1f), 255, 100, 108, 24);
            shopBubble.onEntityEnterColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.sendChatMessageToPlayer(player, "~g~[~r~Simeon~g~]:~w~ Hey! What can I get you?");
                    API.triggerClientEvent(player, "npcbiz:enterTrigger", "midcar", "Vapid Lot");
                    API.sendNotificationToPlayer(player, "Press ~b~F~w~ to buy a high end car.");
                }
            };
            shopBubble.onEntityExitColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.triggerClientEvent(player, "npcbiz:exitTrigger", "midcar", "Vapid Lot");
                }
            };
        }
示例#10
0
        private void API_onResourceStart()
        {
            var myBlip = API.createBlip(new Vector3(436.0187, -981.6024, 30.69861));

            API.setBlipShortRange(myBlip, true);
            API.setBlipSprite(myBlip, 487);
            API.setBlipColor(myBlip, 63);
            API.setBlipName(myBlip, "LSPD QG");
            API.onClientEventTrigger += OnClientEventTrigger;

            var pnj = API.createPed((PedHash)1581098148, new Vector3(441.1486, -978.8523, 30.68961), 169.0241f, 0);

            API.setEntitySyncedData(pnj, "Interaction", "Cops");

            Vector3  position  = new Vector3(1717.663, 2531.471, 45.5649);
            ColShape JailShape = API.createCylinderColShape(position, 59f, 20f);

            JailShape.onEntityExitColShape += (shape, entity) =>
            {
                var players = API.getPlayerFromHandle(entity);
                if (players != null)
                {
                    if (players.getData("Jailed") == true)
                    {
                        players.position = position;
                    }
                }
            };
        }
示例#11
0
 public void onCollisionExit(Client p, ColShape c)
 {
     if (p.vehicleSeat == -1)
     {
         API.triggerClientEvent(p, "hide_menu");
     }
 }
示例#12
0
        public async Task CMD_crearnegocio(Player player, int type)
        {
            //var user = player.GetExternalData<Data.Entities.User>(0);
            if (!player.HasData("USER_CLASS"))
            {
                return;
            }
            Data.Entities.User user = player.GetData <Data.Entities.User>("USER_CLASS");
            if (user.adminLv == 5)
            {
                if (type == 1 || type == 2)
                {
                    int bankId = await World.Banks.DatabaseFunctions.CreateBank(player, type);

                    ColShape  bank   = NAPI.ColShape.CreateCylinderColShape(player.Position, 2, 6);
                    TextLabel label  = NAPI.TextLabel.CreateTextLabel("Pulsa ~y~F5 ~w~para interactuar", player.Position.Subtract(new Vector3(0, 0, 0.1)), 15, 6, 2, new Color(255, 255, 255));
                    Marker    marker = NAPI.Marker.CreateMarker(0, player.Position.Subtract(new Vector3(0, 0, 0.1)), new Vector3(), new Vector3(), 1, new Color(251, 244, 1));
                    Blip      blip   = NAPI.Blip.CreateBlip(player.Position);

                    if (type == 1)
                    {
                        blip.Sprite     = 108;
                        blip.Scale      = 1f;
                        blip.ShortRange = true;
                        blip.Name       = "Banco";
                        blip.Color      = 5;
                    }
                    else
                    {
                        blip.Sprite     = 277;
                        blip.Scale      = 1f;
                        blip.ShortRange = true;
                        blip.Name       = "ATM";
                        blip.Color      = 5;
                    }

                    Data.Entities.Bank banco = new Data.Entities.Bank
                    {
                        blip   = blip,
                        marker = marker,
                        label  = label,
                        id     = bankId,
                        type   = type
                    };

                    //bank.SetExternalData<Data.Entities.Bank>(0, banco);
                    bank.SetData("BANK_CLASS", banco);

                    Utilities.Notifications.SendNotificationOK(player, $"Has creado el banco con ID {bankId}");
                }
                else
                {
                    player.SendChatMessage("<font color='red'>ERROR</font> No existe ese tipo de banco");
                }
            }
            else
            {
                player.SendChatMessage("<font color='red'>[ERROR]</font> El comando no existe. (/ayuda para mas información)");
            }
        }
示例#13
0
        private static void order_onEntityExit(ColShape shape, Client player)
        {
            try
            {
                if (shape.GetData("PASSAGER") != player)
                {
                    return;
                }

                if (player.HasData("TAXI_DRIVER"))
                {
                    Client driver = player.GetData("TAXI_DRIVER");
                    driver.ResetData("PASSAGER");
                    player.ResetData("TAXI_DRIVER");
                    player.SetData("IS_CALL_TAXI", false);
                    Notify.Send(driver, NotifyType.Warning, NotifyPosition.BottomCenter, $"Пассажир отменил заказ", 3000);
                    Notify.Send(player, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы покинули место вызова такси", 3000);
                    try
                    {
                        NAPI.ColShape.DeleteColShape(orderCols[player]);
                        orderCols.Remove(player);
                    }
                    catch { }
                }
            }
            catch (Exception ex) { Log.Write("order_onEntityExit: " + ex.Message, nLog.Type.Error); }
        }
示例#14
0
        public void RepairMarker3(Client client)
        {
            ColShape colShape = NAPI.ColShape.CreateCylinderColShape(new Vector3(-965.0243, -3024.913, 13.56587), 3, 4);
            Marker   repair3  = NAPI.Marker.CreateMarker(0, new Vector3(-965.0243, -3024.913, 13.56587), new Vector3(), new Vector3(0, 0, 6.967081), 1, new Color(16, 78, 139, 100));

            colShape.SetData("repair3", repair3);
        }
示例#15
0
        /// <summary>
        /// Обработчик входа в гараж тюнинга
        /// </summary>
        private void EnterToTuningGarage(ColShape shape, NetHandle entity)
        {
            var     player  = API.getPlayerFromHandle(entity);
            Vehicle vehicle = null;

            if (!CanEnter(player, ref vehicle))
            {
                return;
            }
            player.setSyncedData(IN_TUNING_GARAGE, true);
            var accountId = (int)_playerInfoManager.GetInfo(player).AccountId;

            API.setEntityDimension(player, -accountId);
            API.setEntityDimension(vehicle, -accountId);
            API.setEntityPosition(vehicle, _afterEnterPosition);
            API.setEntityRotation(vehicle, _afterEnterRotation);
            while (!vehicle.freezePosition)
            {
                vehicle.freezePosition = true;
            }
            var model = (VehicleHash)API.getEntityModel(vehicle);

            API.sendNativeToPlayer(player, Hash.DISPLAY_RADAR, false);
            API.triggerClientEvent(player, ServerEvent.SHOW_HINT, "Если случайно закрылось меню, нажмите О, чтобы снова открыть", 120);
            API.triggerClientEvent(player, ServerEvent.SHOW_TUNING_MENU, JsonConvert.SerializeObject(GetParsedMods(vehicle)), API.isVehicleACar(model));
        }
示例#16
0
 public void onPlayerEntercolShape(ColShape shape, Player player)
 {
     if (shape.HasData("gasStation") && shape.HasData("bizid"))
     {
         player.TriggerEvent("onPlayerEnterGasStation", business.businessList.Find(shop => shop.bizId == shape.GetData <int>("bizid")));
     }
 }
示例#17
0
        private void ColShapeTriggerEnter(ColShape colshape, NetHandle entity)
        {
            var player = API.getPlayerFromHandle(entity);

            if (player == null)
            {
                return;
            }

            if (colshape != null && colshape.getData("IS_ATM_TRIGGER") == true)
            {
                var id     = colshape.getData("ATM_ID");
                var type   = colshape.getData("ATM_TYPE");
                var amount = colshape.getData("ATM_AMOUNT");
                var info   = colshape.getData("ATM_INFO");
                var blip   = colshape.getData("ATM_BLIP");
                var marker = colshape.getData("ATM_MARKER");
                var text   = colshape.getData("ATM_TEXT");
                player.setData("IN_ATM_COLSHAPE", colshape);
                player.setData("IN_ATM", id);
                player.setData("IN_ATM_TYPE", type);
                player.setData("IN_ATM_AMOUNT", amount);
                player.setData("IN_ATM_ID", id);
                player.setData("IN_ATM_BLIP", blip);
                player.setData("IN_ATM_MARKER", marker);
                player.setData("IN_ATM_TEXT", text);
            }
        }
        /// <summary>
        /// Показать следующую остановку
        /// </summary>
        private void ShowNextStop(Client player, ColShape shape, string shapeValue)
        {
            var currentStop = _points.First(e => e.ColShape == shape);

            player.setData(SHAPE_KEY, string.Format(shapeValue, currentStop.NextPointNumber));
            API.triggerClientEvent(player, ClientEvent.SHOW_NEXT_BUS_STOP, currentStop.NextPoint);
        }
示例#19
0
        private void OnEntityExitColShape(ColShape colshape, NetHandle entity)
        {
            if (API.getEntityType(entity) != EntityType.Player)
            {
                return;
            }
            foreach (var gs in GasStation.GasStations)
            {
                if (gs.RefillArea1 != colshape && gs.RefillArea2 != colshape)
                {
                    continue;
                }
                if (API.getEntityType(entity) != EntityType.Player)
                {
                    continue;
                }
                Client player = API.getPlayerFromHandle(entity);
                Player p      = Player.PlayerData[player];

                API.triggerClientEvent(player, "OnLeaveGasStation");
                p.HasEnteredGasStation = 0;
                if (p.SelectedCash != null)
                {
                    InventoryRepository.UpdateAsync(p.SelectedCash);
                }
                else if (p.SelectedCardAccount != null)
                {
                    BankRepository.UpdateAsync(p.SelectedCardAccount);
                }
            }
        }
示例#20
0
文件: bank.cs 项目: nxxnly/athronsrpg
 public void onPlayerEntercolShape(ColShape shape, Player player)
 {
     if (shape.HasData("bank") && shape.HasData("bizid"))
     {
         player.SetData("enteredBank", shape.GetData <int>("bizid"));
     }
 }
示例#21
0
        public void RacePadd(Client player)
        {
            race_struct rs = new race_struct();

            rs.creator = null;
            foreach (race_struct rsI in lst_rs)
            {
                if (rsI.creator == player)
                {
                    rs = rsI;
                }
            }
            if (rs.creator == null)
            {
                API.sendChatMessageToPlayer(player, "Du hast kein Rennen erstellt.");
            }
            else
            {
                Client pl = player;
                API.triggerClientEvent(pl, "racecp");
                ColShape cs = API.createCylinderColShape(pl.position, 10, 5);
                rs.listcs.Add(cs);
                int i = rs.listcs.IndexOf(cs) + 1;
                //  command = connection.CreateCommand();
                // command.CommandText = "CREATE TABLE `racedb`.`race" + da + "_cp" + i + "` ( `name` VARCHAR(255) NOT NULL , `time` INT NOT NULL , PRIMARY KEY (`name`)) ENGINE = InnoDB;";
                //connection.Open();
                //command.ExecuteNonQuery();
                //command.Connection.Close();

                API.sendNotificationToPlayer(player, "Checkpoint erfolgreich erstellt");
            }
        }
示例#22
0
        public void OnPlayerExitColShape(ColShape colshape, Player entity)
        {
            if (colshape.HasData("property_entrance"))
            {
                if (NAPI.Data.GetEntityData(entity, "at_interance_property_id") == colshape.GetData <int>("property_entrance"))
                {
                    NAPI.Data.ResetEntityData(entity, "at_interance_property_id");
                }
            }

            if (colshape.HasData("property_interaction"))
            {
                if (NAPI.Data.GetEntityData(entity, "at_interaction_property_id") == colshape.GetData <int>("property_interaction"))
                {
                    NAPI.Data.ResetEntityData(entity, "at_interaction_property_id");
                }
            }

            if (colshape.HasData("property_garbage"))
            {
                if (NAPI.Data.GetEntityData(entity, "at_garbage_property_id") == colshape.GetData <int>("property_garbage"))
                {
                    NAPI.Data.ResetEntityData(entity, "at_garbage_property_id");
                }
            }

            if (colshape.HasData("property_exit"))
            {
                if (NAPI.Data.GetEntityData(entity, "at_exit_property_id") == colshape.GetData <int>("property_exit"))
                {
                    NAPI.Data.ResetEntityData(entity, "at_exit_property_id");
                }
            }
        }
示例#23
0
        public void onEntityEnterColShapeHandler(ColShape shape, NetHandle entity)
        {
            entra   = true;
            termina = false;
            var player = API.getPlayerFromHandle(entity);

            if (i == 1)
            {
                API.triggerClientEvent(player, "MUSIC");
            }
            burguer = API.createObject(759729215, new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
            API.attachEntityToEntity(burguer, player, "IK_R_Hand", new Vector3(0, 0, 0), new Vector3(0, 0, 0));
            API.sendChatMessageToPlayer(player, String.Format("Este es el punto del reparto ({0}/5) ", i));

            if (API.doesEntityExist(Marker))
            {
                API.deleteColShape(shape);
                API.deleteEntity(Marker);
            }

            if (i == 5)
            {
                API.triggerClientEvent(player, "stop_music");
                API.sendNotificationToPlayer(player, "Música para");
            }
        }
示例#24
0
        private void createTrigger()
        {
            ColShape shopTrigger = API.createCylinderColShape(shopTriggerPos, 1f, 3f);

            API.createMarker(1, shopTriggerPos, new Vector3(), new Vector3(),
                             new Vector3(1f, 1f, 1f), 255, 100, 108, 24);

            var blip = API.createBlip(shopTriggerPos);

            blip.name       = shopName;
            blip.sprite     = 71;
            blip.shortRange = true;

            shopTrigger.onEntityEnterColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.sendChatMessageToPlayer(player, "~g~[~o~" + chatName + "~g~]:~w~ Hey! Let's clean up that head.");
                    API.sendNotificationToPlayer(player, "Press ~b~F~w~ to use the shop.");
                    API.triggerClientEvent(player, "npcbiz:triggerEnter", "hair", shopName);
                }
            };

            shopTrigger.onEntityExitColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.triggerClientEvent(player, "npcbiz:triggerExit", "hair", shopName);
                }
            };
        }
示例#25
0
 /// <summary>
 /// Обработчик выхода из маркера
 /// </summary>
 private void OnEntityExitColShape(ColShape shape, NetHandle entity) {
     var player = API.getPlayerFromHandle(entity);
     if (!PlayerHelper.PlayerCorrect(player)) {
         return;
     }
     API.triggerClientEvent(player, ServerEvent.HIDE_FISHERMAN_MENU);
 }
示例#26
0
        public void OnDeliveryApples(ColShape shape, Player player)
        {
            if (shape.GetData <bool>(APPLECOL_DELIVERY_COLSHAPE))
            {
                if (player.GetData <Job.eJobs>(EntityData.PLAYER_JOB) != Job.eJobs.AppleCollector)
                {
                    return;
                }

                if (player.GetData <int>(APPLECOL_UNITS_HAVE) == 0)
                {
                    player.SendChatMessage($"{Utils.Colors.YELLOW}[Яблочная ферма]: {Utils.Colors.WHITE}У Вас нет яблок!");
                    return;
                }

                player.SetData <int>(APPLECOL_UNITS_DELIVED, player.GetData <int>(APPLECOL_UNITS_DELIVED) + player.GetData <int>(APPLECOL_UNITS_HAVE));
                player.SetData <int>(APPLECOL_UNITS_HAVE, 0);

                player.SendChatMessage($"{Utils.Colors.YELLOW}[Яблочная ферма]: {Utils.Colors.WHITE}Вы положили яблоки в ящик. Всего собрано {Utils.Colors.YELLOW}{player.GetData<int>(APPLECOL_UNITS_DELIVED)} {Utils.Colors.WHITE}яблок!");

                player.SetData <double>(EntityData.PLAYER_JOB_SALARY, GetSalary(player));

                CreatePoint(player);
            }
        }
示例#27
0
        public void onResourceStart()
        {
            InfoShape = API.createCylinderColShape(PoliceStationPos, 2f, 3f);

            API.createMarker(1, PoliceStationPos - new Vector3(0, 0, 1f), new Vector3(), new Vector3(),
                             new Vector3(1f, 1f, 1f), 100, 255, 255, 255);

            InfoShape.onEntityEnterColShape += (shape, entity) =>
            {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    if (API.getEntityData(player, "IS_COP") == true)
                    {
                        API.sendChatMessageToPlayer(player, "Use /mission to start a mission!");
                    }
                    else
                    {
                        var fine = CopUtil.CalculatePlayerFine(player);

                        API.sendChatMessageToPlayer(player, "Use /payfine to pay your fine" + (fine > 0 ? " of $" + fine + "." : "."));
                        //API.sendChatMessageToPlayer(player, "Use /surrender to serve your sentence.");
                    }
                }
            };
        }
示例#28
0
        private void ColShapeTrigger(ColShape colshape, NetHandle entity)
        {
            var player = API.GetPlayerFromHandle(entity);

            if (player == null)
            {
                return;
            }

            if (colshape != null && colshape.GetData("IS_DOOR_TRIGGER") == true)
            {
                var id   = colshape.GetData("DOOR_ID");
                var info = colshape.GetData("DOOR_INFO");

                float heading = 0f;

                if (info.State != null)
                {
                    heading = info.State;
                }

                API.SendNativeToPlayer(player, SET_STATE_OF_CLOSEST_DOOR_OF_TYPE,
                                       info.Hash, info.Position.X, info.Position.Y, info.Position.Z,
                                       info.Locked, heading, false);
            }
        }
示例#29
0
        private void npcTriggers()
        {
            var ped = API.createPed(API.pedNameToModel("Autoshop02SMM"), npcPos, 128f);

            API.playPedScenario(ped, "WORLD_HUMAN_CLIPBOARD");

            var blip = API.createBlip(npcPos);

            blip.name       = "La Mesa Trucks";
            blip.sprite     = 477;
            blip.shortRange = true;

            ColShape shopBubble = API.createSphereColShape(npcPos, 3f);

            shopBubble.onEntityEnterColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.sendChatMessageToPlayer(player, "~g~[~r~Dealer~g~]:~w~ I heard you like trucks.");
                    API.triggerClientEvent(player, "npcbiz:enterTrigger", "truck", "La Mesa Trucks");
                    API.sendNotificationToPlayer(player, "Press ~b~F~w~ to buy a truck.");
                }
            };
            shopBubble.onEntityExitColShape += (shape, entity) => {
                Client player;
                if ((player = API.getPlayerFromHandle(entity)) != null)
                {
                    API.triggerClientEvent(player, "npcbiz:exitTrigger", "truck", "La Mesa Trucks");
                }
            };
        }
示例#30
0
        //REPAIR
        public void RepairMarker1(Client client)
        {
            ColShape colShape = NAPI.ColShape.CreateCylinderColShape(new Vector3(731.3959, -1088.848, 22.16904), 3, 4);
            Marker   repair1  = NAPI.Marker.CreateMarker(0, new Vector3(731.3959, -1088.848, 22.16904), new Vector3(), new Vector3(0, 0, 270.1672), 1, new Color(16, 78, 139, 100));

            colShape.SetData("repair1", repair1);
        }