Esempio n. 1
0
        public void setskin(Client player, string IDOrName, PedHash Model)
        {
            AccountController account = player.getData("ACCOUNT");

            if (account == null)
            {
                return;
            }
            if (AdminController.AdminRankCheck("setskin", account))
            {
                AccountController targetAccount = EntityManager.GetUserAccount(player, IDOrName);
                if (targetAccount == null)
                {
                    API.sendChatMessageToPlayer(player, "~r~[ERROR]: ~w~You specified an invalid player ID.");
                }
                else
                {
                    API.setPlayerSkin(targetAccount.Client, Model);
                    API.shared.sendChatMessageToPlayer(targetAccount.Client, "Administrator " + account.CharacterController.FormatName + " set your skin to: " + Model.ToString());
                    targetAccount.CharacterController.Character.Model = Model.GetHashCode();
                }
            }
        }
Esempio n. 2
0
        public async override void OnStart(Ped player)
        {
            base.OnStart(player);
            Random  random     = new Random();
            string  animaltype = animalList[random.Next(animalList.Length)];
            PedHash Hash       = (PedHash)API.GetHashKey(animaltype);

            animal = await SpawnPed(Hash, Location);

            victim = await SpawnPed(RandomUtils.GetRandomPed(), Location);

            API.SetAnimalMood(Hash.GetHashCode(), 1);
            animal.AlwaysKeepTask       = true;
            animal.BlockPermanentEvents = true;
            victim.AlwaysKeepTask       = true;
            victim.BlockPermanentEvents = true;
            Notify("~r~[AnimalCallouts] ~y~Victim is being chased by a mountain lion!");
            animal.AttachBlip();
            victim.AttachBlip();
            victim.Task.ReactAndFlee(animal);
            API.Wait(500);
            animal.Task.FightAgainst(victim);
        }