Beispiel #1
0
        public void LoadCharacterEvent(Client player, string name)
        {
            Task.Factory.StartNew(() => {
                var playerModel = Database.LoadCharacterInformationByName(name);
                var skinModel   = Database.GetCharacterSkin(playerModel.id);

                // Load player's model
                player.Name = playerModel.realName;
                player.SetData(EntityData.PLAYER_SKIN_MODEL, skinModel);
                NAPI.Player.SetPlayerSkin(player,
                                          playerModel.sex == 0 ? PedHash.FreemodeMale01 : PedHash.FreemodeFemale01);

                Character.LoadCharacterData(player, playerModel);
                Customization.ApplyPlayerCustomization(player, skinModel, playerModel.sex);
                Customization.ApplyPlayerClothes(player);
                Customization.ApplyPlayerTattoos(player);

                // Update last selected character
                Database.UpdateLastCharacter(player.SocialClubName, playerModel.id);
            });
        }
Beispiel #2
0
        public void SetCharacterIntoCreatorEvent(Client player)
        {
            // Change player's skin
            NAPI.Player.SetPlayerSkin(player, PedHash.FreemodeMale01);

            // Remove clothes
            player.SetClothes(11, 15, 0);
            player.SetClothes(3, 15, 0);
            player.SetClothes(8, 15, 0);

            // Remove all the tattoos
            Customization.RemovePlayerTattoos(player);

            // Set player's position
            player.Transparency = 255;
            player.Rotation     = new Vector3(0.0f, 0.0f, 180.0f);
            player.Position     = new Vector3(402.9364f, -996.7154f, -99.00024f);

            // Force the player's animation
            player.PlayAnimation("amb@world_human_hang_out_street@female_arms_crossed@base", "base",
                                 (int)Constants.AnimationFlags.Loop);
        }