コード例 #1
0
        public static void StartWorkDay(Client player)
        {
            if (Main.Players[player].WorkID != 1)
            {
                Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, "Вы не работаете электриком. Устроиться можно в мэрии", 3000);
                return;
            }
            if (player.GetData("ON_WORK"))
            {
                Customization.ApplyCharacter(player);
                player.SetData("ON_WORK", false);
                Trigger.ClientEvent(player, "deleteCheckpoint", 15);
                Trigger.ClientEvent(player, "deleteWorkBlip");

                Notify.Send(player, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы закончили рабочий день", 3000);
                //player.SetData("PAYMENT", 0);
                return;
            }
            else
            {
                Customization.ClearClothes(player, Main.Players[player].Gender);
                if (Main.Players[player].Gender)
                {
                    player.SetAccessories(1, 24, 2);
                    player.SetClothes(3, 16, 0);
                    player.SetClothes(11, 153, 10);
                    player.SetClothes(4, 0, 5);
                    player.SetClothes(6, 24, 0);
                }
                else
                {
                    player.SetAccessories(1, 26, 2);
                    player.SetClothes(3, 17, 0);
                    player.SetClothes(11, 150, 1);
                    player.SetClothes(4, 1, 5);
                    player.SetClothes(6, 52, 0);
                }

                var check = WorkManager.rnd.Next(0, Checkpoints.Count - 1);
                player.SetData("WORKCHECK", check);
                Trigger.ClientEvent(player, "createCheckpoint", 15, 1, Checkpoints[check].Position, 1, 0, 255, 0, 0);
                Trigger.ClientEvent(player, "createWorkBlip", Checkpoints[check].Position);

                player.SetData("ON_WORK", true);
                Notify.Send(player, NotifyType.Info, NotifyPosition.BottomCenter, "Вы начали рабочий день", 3000);
                return;
            }
        }
コード例 #2
0
ファイル: Police.cs プロジェクト: alexenin/romantic
        private static void callback_policeSpecial(Client client, Menu menu, Menu.Item item, string eventName, dynamic data)
        {
            switch (item.ID)
            {
            case "changeclothes":
                if (!NAPI.Data.GetEntityData(client, "IN_CP_MODE"))
                {
                    bool gender = Main.Players[client].Gender;
                    Customization.ApplyCharacter(client);
                    Customization.ClearClothes(client, gender);
                    if (gender)
                    {
                        Customization.SetHat(client, 39, 0);
                        //client.SetClothes(1, 52, 0);
                        client.SetClothes(11, 53, 0);
                        client.SetClothes(4, 31, 0);
                        client.SetClothes(6, 25, 0);
                        client.SetClothes(9, 15, 2);
                        client.SetClothes(3, 49, 0);
                    }
                    else
                    {
                        Customization.SetHat(client, 38, 0);
                        //client.SetClothes(1, 57, 0);
                        client.SetClothes(11, 46, 0);
                        client.SetClothes(4, 30, 0);
                        client.SetClothes(6, 25, 0);
                        client.SetClothes(9, 17, 2);
                        client.SetClothes(3, 53, 0);
                    }
                    if (client.HasData("HAND_MONEY"))
                    {
                        client.SetClothes(5, 45, 0);
                    }
                    else if (client.HasData("HEIST_DRILL"))
                    {
                        client.SetClothes(5, 41, 0);
                    }
                    NAPI.Data.SetEntityData(client, "IN_CP_MODE", true);
                    return;
                }
                Fractions.Manager.setSkin(client, 7, Main.Players[client].FractionLVL);
                client.SetData("IN_CP_MODE", false);
                return;

            case "pistol50":
                Fractions.Manager.giveGun(client, Weapons.Hash.Pistol50, "pistol50");
                return;

            case "carbineRifle":
                Fractions.Manager.giveGun(client, Weapons.Hash.CarbineRifle, "carbineRifle");
                return;

            case "riflesammo":
                if (!Manager.canGetWeapon(client, "RiflesAmmo"))
                {
                    return;
                }
                Fractions.Manager.giveAmmo(client, ItemType.RiflesAmmo, 30);
                return;

            case "heavyshotgun":
                Fractions.Manager.giveGun(client, Weapons.Hash.HeavyShotgun, "heavyshotgun");
                return;

            case "stungun":
                Fractions.Manager.giveGun(client, Weapons.Hash.StunGun, "stungun");
                return;

            case "close":
                MenuManager.Close(client);
                return;
            }
        }
コード例 #3
0
ファイル: WorkManager.cs プロジェクト: alexenin/romantic
        private static void callback_gpStartMenu(Client client, Menu menu, Menu.Item item, string eventName, dynamic data)
        {
            if (!Main.Players.ContainsKey(client) || client.Position.DistanceTo(Gopostal.Coords[0]) > 15)
            {
                MenuManager.Close(client);
                return;
            }
            switch (item.ID)
            {
            case "start":
                if (Main.Players[client].WorkID == 2)
                {
                    if (!NAPI.Data.GetEntityData(client, "ON_WORK"))
                    {
                        if (Houses.HouseManager.Houses.Count == 0)
                        {
                            return;
                        }
                        client.SetData("PACKAGES", 10);
                        Notify.Send(client, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы получили 10 посылок, развезите их по домам", 3000);
                        client.SetData("ON_WORK", true);

                        client.SetData("W_LASTPOS", client.Position);
                        client.SetData("W_LASTTIME", DateTime.Now);
                        var next = Jobs.WorkManager.rnd.Next(0, Houses.HouseManager.Houses.Count - 1);
                        while (Houses.HouseManager.Houses[next].Position.DistanceTo2D(client.Position) < 200)
                        {
                            next = Jobs.WorkManager.rnd.Next(0, Houses.HouseManager.Houses.Count - 1);
                        }

                        client.SetData("NEXTHOUSE", Houses.HouseManager.Houses[next].ID);
                        Trigger.ClientEvent(client, "createCheckpoint", 1, 1, Houses.HouseManager.Houses[next].Position, 1, 0, 255, 0, 0);
                        Trigger.ClientEvent(client, "createWaypoint", Houses.HouseManager.Houses[next].Position.X, Houses.HouseManager.Houses[next].Position.Y);
                        Trigger.ClientEvent(client, "createWorkBlip", Houses.HouseManager.Houses[next].Position);

                        var gender = Main.Players[client].Gender;
                        Customization.ClearClothes(client, gender);
                        if (gender)
                        {
                            Customization.SetHat(client, 76, 10);
                            client.SetClothes(11, 38, 3);
                            client.SetClothes(4, 17, 0);
                            client.SetClothes(6, 1, 7);
                            client.SetClothes(3, Core.Customization.CorrectTorso[gender][38], 0);
                        }
                        else
                        {
                            Customization.SetHat(client, 75, 10);
                            client.SetClothes(11, 0, 6);
                            client.SetClothes(4, 25, 2);
                            client.SetClothes(6, 1, 2);
                            client.SetClothes(3, Core.Customization.CorrectTorso[gender][0], 0);
                        }

                        int x = Jobs.WorkManager.rnd.Next(0, Gopostal.GoPostalObjects.Count);
                        BasicSync.AttachObjectToPlayer(client, Jobs.Gopostal.GoPostalObjects[x], 60309, new Vector3(0.03, 0, 0.02), new Vector3(0, 0, 50));
                    }
                    else
                    {
                        Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы уже начали рабочий день", 3000);
                    }
                }
                else
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не работаете курьером. Устроиться можно в мэрии", 3000);
                }
                return;

            case "get":
            {
                if (Main.Players[client].WorkID != 2)
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не работаете курьером", 3000);
                    return;
                }
                if (!client.GetData("ON_WORK"))
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не начали рабочий день", 3000);
                    return;
                }
                if (client.GetData("PACKAGES") != 0)
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не раздали все посылки. У Вас осталось ещё {client.GetData("PACKAGES")} штук", 3000);
                    return;
                }
                if (Houses.HouseManager.Houses.Count == 0)
                {
                    return;
                }
                client.SetData("PACKAGES", 10);
                Notify.Send(client, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы получили 10 посылок. Развезите их по домам", 3000);

                client.SetData("W_LASTPOS", client.Position);
                client.SetData("W_LASTTIME", DateTime.Now);
                var next = Jobs.WorkManager.rnd.Next(0, Houses.HouseManager.Houses.Count - 1);
                while (Houses.HouseManager.Houses[next].Position.DistanceTo2D(client.Position) < 200)
                {
                    next = Jobs.WorkManager.rnd.Next(0, Houses.HouseManager.Houses.Count - 1);
                }
                client.SetData("NEXTHOUSE", Houses.HouseManager.Houses[next].ID);

                Trigger.ClientEvent(client, "createCheckpoint", 1, 1, Houses.HouseManager.Houses[next].Position, 1, 0, 255, 0, 0);
                Trigger.ClientEvent(client, "createWaypoint", Houses.HouseManager.Houses[next].Position.X, Houses.HouseManager.Houses[next].Position.Y);
                Trigger.ClientEvent(client, "createWorkBlip", Houses.HouseManager.Houses[next].Position);

                int y = Jobs.WorkManager.rnd.Next(0, Jobs.Gopostal.GoPostalObjects.Count);
                BasicSync.AttachObjectToPlayer(client, Jobs.Gopostal.GoPostalObjects[y], 60309, new Vector3(0.03, 0, 0.02), new Vector3(0, 0, 50));
                return;
            }

            case "finish":
                if (Main.Players[client].WorkID == 2)
                {
                    if (NAPI.Data.GetEntityData(client, "ON_WORK"))
                    {
                        Trigger.ClientEvent(client, "deleteCheckpoint", 1, 0);
                        BasicSync.DetachObject(client);

                        Notify.Send(client, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы закончили рабочий день", 3000);
                        Trigger.ClientEvent(client, "deleteWorkBlip");

                        client.SetData("PAYMENT", 0);
                        Customization.ApplyCharacter(client);
                        if (client.HasData("HAND_MONEY"))
                        {
                            client.SetClothes(5, 45, 0);
                        }
                        else if (client.HasData("HEIST_DRILL"))
                        {
                            client.SetClothes(5, 41, 0);
                        }

                        client.SetData("PACKAGES", 0);
                        client.SetData("ON_WORK", false);

                        if (client.GetData("WORK") != null)
                        {
                            NAPI.Entity.DeleteEntity(client.GetData("WORK"));
                            client.SetData("WORK", null);
                        }
                    }
                    else
                    {
                        Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не работаете", 3000);
                    }
                }
                else
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не работаете курьером", 3000);
                }
                return;

            case "close":
                MenuManager.Close(client);
                return;
            }
        }
コード例 #4
0
ファイル: Army.cs プロジェクト: shtudent/PlatinumWay
        private static void callback_armycombat(Client client, Menu menu, Menu.Item item, string eventName, dynamic data)
        {
            if (item.ID == "back")
            {
                MenuManager.Close(client);
                OpenArmyClothesMenu(client);
                return;
            }
            if (Main.Players[client].FractionID != 14)
            {
                Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не служите в армии", 3000);
                return;
            }
            if (!client.GetData("ON_DUTY"))
            {
                Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы должны начать службу", 3000);
                return;
            }
            client.SetData("IN_CP_MODE", true);
            var gender = Main.Players[client].Gender;

            Customization.ClearClothes(client, gender);
            switch (item.ID)
            {
            case "cam1":
                if (gender)
                {
                    client.SetClothes(1, 104, 5);
                    Customization.SetHat(client, 117, 13);
                    client.SetClothes(11, 221, 5);
                    client.SetClothes(4, 87, 5);
                    client.SetClothes(6, 62, 0);
                    client.SetClothes(9, 16, 0);
                    client.SetClothes(3, 49, 1);
                }
                else
                {
                    Customization.SetHat(client, 116, 13);
                    client.SetClothes(1, 104, 5);
                    client.SetClothes(4, 90, 5);
                    client.SetClothes(11, 224, 5);
                    client.SetClothes(6, 65, 0);
                    client.SetClothes(3, 46, 1);
                    client.SetClothes(9, 18, 0);
                }
                return;

            case "cam2":
                if (gender)
                {
                    client.SetClothes(1, 104, 10);
                    Customization.SetHat(client, 117, 18);
                    client.SetClothes(11, 222, 10);
                    client.SetClothes(4, 87, 10);
                    client.SetClothes(6, 62, 2);
                    client.SetClothes(9, 16, 2);
                    client.SetClothes(3, 48, 0);
                }
                else
                {
                    Customization.SetHat(client, 116, 18);
                    client.SetClothes(1, 104, 10);
                    client.SetClothes(4, 90, 10);
                    client.SetClothes(11, 224, 10);
                    client.SetClothes(6, 65, 2);
                    client.SetClothes(3, 46, 0);
                    client.SetClothes(9, 18, 2);
                }
                return;

            case "cam3":
                if (gender)
                {
                    client.SetClothes(1, 104, 15);
                    Customization.SetHat(client, 117, 22);
                    client.SetClothes(11, 220, 15);
                    client.SetClothes(4, 87, 15);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(9, 16, 2);
                    client.SetClothes(3, 49, 0);
                }
                else
                {
                    Customization.SetHat(client, 116, 22);
                    client.SetClothes(1, 104, 15);
                    client.SetClothes(4, 90, 15);
                    client.SetClothes(11, 224, 15);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(3, 46, 0);
                    client.SetClothes(9, 18, 2);
                }
                return;

            case "cam4":
                if (gender)
                {
                    client.SetClothes(1, 104, 12);
                    Customization.SetHat(client, 117, 20);
                    client.SetClothes(11, 221, 12);
                    client.SetClothes(4, 87, 12);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(9, 16, 2);
                    client.SetClothes(3, 49, 0);
                }
                else
                {
                    Customization.SetHat(client, 116, 20);
                    client.SetClothes(1, 104, 12);
                    client.SetClothes(4, 90, 12);
                    client.SetClothes(11, 224, 12);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(3, 46, 0);
                    client.SetClothes(9, 18, 2);
                }
                return;

            case "cam5":
                if (gender)
                {
                    client.SetClothes(1, 104, 16);
                    Customization.SetHat(client, 117, 23);
                    client.SetClothes(11, 220, 16);
                    client.SetClothes(4, 87, 16);
                    client.SetClothes(6, 62, 7);
                    client.SetClothes(9, 16, 0);
                    client.SetClothes(3, 48, 0);
                }
                else
                {
                    Customization.SetHat(client, 116, 23);
                    client.SetClothes(1, 104, 16);
                    client.SetClothes(4, 90, 16);
                    client.SetClothes(11, 224, 16);
                    client.SetClothes(6, 65, 7);
                    client.SetClothes(3, 46, 1);
                    client.SetClothes(9, 18, 0);
                }
                return;

            case "cam6":
                if (gender)
                {
                    client.SetClothes(1, 104, 11);
                    Customization.SetHat(client, 117, 19);
                    client.SetClothes(11, 222, 11);
                    client.SetClothes(4, 87, 11);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(9, 16, 2);
                    client.SetClothes(3, 48, 0);
                }
                else
                {
                    Customization.SetHat(client, 116, 19);
                    client.SetClothes(1, 104, 11);
                    client.SetClothes(4, 90, 11);
                    client.SetClothes(11, 224, 10);
                    client.SetClothes(6, 25, 0);
                    client.SetClothes(3, 46, 0);
                    client.SetClothes(9, 18, 2);
                }
                return;

            case "takeoff":
                Manager.setSkin(client, Main.Players[client].FractionID, Main.Players[client].FractionLVL);
                client.SetData("IN_CP_MODE", false);
                return;
            }
        }