Beispiel #1
0
        public static async void JailFreePlayer()
        {
            if ((int)await Client.Sync.Data.Get(User.GetServerId(), "jail_time") > User.Data.jail_time + 10)
            {
                User.Kick("Pidaras dont use CHEAT ENGINE");
                Main.SaveLog("UseCheatEngine", $"{User.Data.rp_name} ({User.Data.id} | JAIL_TIME)");
                return;
            }

            User.Data.jail_time = 0;
            Client.Sync.Data.Set(User.GetServerId(), "jail_time", User.Data.jail_time);
            Client.Sync.Data.ResetLocally(User.GetServerId(), "jailedCop");

            await Delay(500);

            Notification.SendWithTime("~g~Вы отплатили свой долг. Теперь вы свободны.");
            User.Teleport(Client.Sync.Data.HasLocally(User.GetServerId(), "jailedCop") ? JailCopFree : JailFree);
            Characher.UpdateCloth();
            Jobs.JailJob.TakeMoneyJail();
        }
Beispiel #2
0
        public static async void SpawnPlayer(string skin, float x, float y, float z, float heading, bool checkIsLogin = false, bool isFreeze = true, bool isInvisible = true)
        {
            if (_spawnLock)
            {
                return;
            }

            _spawnLock = true;

            DoScreenFadeOut(500);

            while (IsScreenFadingOut())
            {
                await Delay(1);
            }

            if (isFreeze)
            {
                User.Freeze(PlayerId(), true);
            }

            if (isInvisible)
            {
                User.Invisible(PlayerId(), true);
            }

            uint spawnModel = (uint)GetHashKey(skin);

            //NetworkFadeOutEntity(GetPlayerPed(-1), true, true);

            RequestModel(spawnModel);
            while (!HasModelLoaded(spawnModel))
            {
                RequestModel(spawnModel);
                await Delay(1);
            }

            SetPlayerModel(PlayerId(), spawnModel);
            SetModelAsNoLongerNeeded(spawnModel);

            RequestCollisionAtCoord(x, y, z);

            var ped = GetPlayerPed(-1);

            SetEntityCoordsNoOffset(ped, x, y, z, false, false, false);
            NetworkResurrectLocalPlayer(x, y, z, heading, true, true);
            ClearPedTasksImmediately(ped);
            RemoveAllPedWeapons(ped, false);
            User.RemoveWeapons();
            ClearPlayerWantedLevel(PlayerId());

            while (!HasCollisionLoadedAroundEntity(ped))
            {
                await Delay(1);
            }

            if (checkIsLogin)
            {
                await User.GetAllData();

                await User.GetAllSkin();

                User.IsAuth = User.Data.is_auth;

                while (!User.IsLogin())
                {
                    await User.GetAllData();

                    User.IsAuth = User.Data.is_auth;
                    await Delay(500);
                }

                User.Money = User.Data.money;

                //if (User.IsGang())
                Grab.LoadBlips();

                Characher.UpdateFace(false);
                Characher.UpdateCloth(false);
            }

            if (!User.Data.s_is_characher)
            {
                await Delay(10000);
            }

            if (User.GetPlayerVirtualWorld() == -433 || User.GetPlayerVirtualWorld() == -535)
            {
                await Delay(20000);
            }

            if (User.IsLogin() && !User.Data.s_is_characher && User.Data.age == 18 && User.Data.exp_age < 2)
            {
                var rand = new Random();
                User.SetVirtualWorld(rand.Next(10000));
                User.SetSkin("mp_m_freemode_01");

                RequestCollisionAtCoord(9.653649f, 528.3086f, 169.635f);
                await Delay(1000);

                SetEntityCoordsNoOffset(ped, 9.653649f, 528.3086f, 169.635f, false, false, false);
                NetworkResurrectLocalPlayer(9.653649f, 528.3086f, 169.635f, 120.0613f, true, true);

                User.PedRotation(120.0613f);

                User.Freeze(PlayerId(), true);
                MenuList.ShowCharacherCustomMenu();

                /*Camera.Position = new Vector3(-7.973644f, 513.0889f, 174.6281f);
                 * Camera.PointAt(new Vector3(-10.10947f, 508.5056f, 174.6281f));*/

                Characher.UpdateFace();
                Characher.UpdateCloth();

                MenuList.Camera          = new CitizenFX.Core.Camera(CreateCam("DEFAULT_SCRIPTED_CAMERA", true));
                MenuList.Camera.IsActive = true;
                MenuList.Camera.Position = new Vector3(8.243752f, 527.4373f, 171.6173f);
                MenuList.Camera.PointAt(new Vector3(9.653649f, 528.3086f, 171.335f));
                RenderScriptCams(true, false, MenuList.Camera.Handle, false, false);
            }
            //NetworkFadeInEntity(GetPlayerPed(-1), false);

            ShutdownLoadingScreen();
            ShutdownLoadingScreenNui();

            DoScreenFadeIn(500);

            while (IsScreenFadingIn())
            {
                await Delay(1);
            }

            if (isFreeze)
            {
                User.Freeze(PlayerId(), false);
            }

            if (isInvisible)
            {
                User.Invisible(PlayerId(), false);
            }

            _spawnLock = false;

            if (User.IsLogin() && !User.Data.s_is_characher && (User.Data.age == 18 && User.Data.exp_age >= 2 || User.Data.age > 18))
            {
                MenuList.ShowAskCharacherCustomMenu();
            }
        }
Beispiel #3
0
        private static async Task TimerSync()
        {
            await Delay(1000 * 60 * 3);

            if (User.IsLogin())
            {
                //Characher.UpdateCloth(false);
                Characher.UpdateFace();

                if (!User.IsRpAnim)
                {
                    User.RemoveEatLevel(16);
                    User.RemoveWaterLevel(2);
                }

                if (User.TimerAbduction > 0)
                {
                    User.TimerAbduction--;

                    if (User.TimerAbduction == 0)
                    {
                        var rand  = new Random();
                        var index = rand.Next(5);
                        var pos   = new Vector3((float)Main.CartelMiserkPos[index, 0], (float)Main.CartelMiserkPos[index, 1], (float)Main.CartelMiserkPos[index, 2]);

                        Notification.SendPictureToFraction("Мистер К скинул координаты, едем туда", "Мистер К", "Дело", "CHAR_HUMANDEFAULT", Notification.TypeChatbox, 8);
                        Shared.SetWaypointToFraction(8, pos.X, pos.Y);
                        Chat.SendChatMessageWithCommand("По приезду откройте меню организации и нажмите \"Совершить сделку\", нужно находиться рядом с человеком");
                        Checkpoint.CreateWithMarker(pos, 5f, 5f, Marker.Red.R, Marker.Red.G, Marker.Red.B, Marker.Red.A, "checkpoint:withdelete");
                    }
                }

                if (User.GetEatLevel() < 100)
                {
                    SetEntityHealth(GetPlayerPed(-1), GetEntityHealth(GetPlayerPed(-1)) - 2);
                    Notification.SendWithTime("~y~Вы голодны.");

                    if (User.Data.age == 18)
                    {
                        Notification.Send("~g~[HELP] Купите еду в магазине (M -> GPS)");
                    }
                }
                if (User.GetWaterLevel() < 5)
                {
                    SetEntityHealth(GetPlayerPed(-1), GetEntityHealth(GetPlayerPed(-1)) - 2);
                    Notification.SendWithTime("~y~Вы хотите пить.");

                    if (User.Data.age == 18)
                    {
                        Notification.Send("~g~[HELP] Купите воду в магазине (M -> GPS)");
                    }
                }

                if (Client.Sync.Data.HasLocally(User.GetServerId(), "isTie") && User.GetNetwork() > 1)
                {
                    foreach (var p in Main.GetPedListOnRadius(100f))
                    {
                        if (User.IsAnimal(p.Model.Hash))
                        {
                            continue;
                        }
                        var rand = new Random();
                        if (rand.Next(2) != 0)
                        {
                            continue;
                        }
                        p.Task.StartScenario("WORLD_HUMAN_STAND_MOBILE", p.Position);
                        await Delay(10000);

                        if (p.IsDead)
                        {
                            break;
                        }
                        Dispatcher.SendEms("Код 3", "Свидетели сообщают о подозрительной активности");
                        p.Task.ClearAll();
                        break;
                    }
                }

                if (User.IsDead() && User.GetNetwork() > 1)
                {
                    foreach (var p in Main.GetPedListOnRadius(100f))
                    {
                        if (User.IsAnimal(p.Model.Hash))
                        {
                            continue;
                        }
                        p.Task.StartScenario("WORLD_HUMAN_STAND_MOBILE", p.Position);
                        await Delay(10000);

                        if (p.IsDead)
                        {
                            break;
                        }
                        if (await Client.Sync.Data.Has(User.GetServerId(), "deathReason"))
                        {
                            Dispatcher.SendEms("Код 3", User.GetDeathReason((uint)await Client.Sync.Data.Get(User.GetServerId(), "deathReason")));
                        }
                        else
                        {
                            Dispatcher.SendEms("Код 2", User.GetDeathReason(0));
                        }
                        p.Task.ClearAll();
                        break;
                    }
                }
            }
        }