示例#1
0
        void OnItemSelect(UIMenu sender, UIMenuItem item, int index)
        {
            Emote emote = emotes.FirstOrDefault(o => o.Description == item.Text);

            if (emote != null)
            {
                PlayEmote(emote);
            }
            else
            {
                Screen.ShowNotification(errors.ElementAt(1));
            }

            mainMenu.Visible = false;
        }
示例#2
0
        void PlayEmote(Emote emote)
        {
            if (Game.PlayerPed != null)
            {
                bool isInVehicle = Function.Call <bool>(Hash.IS_PED_IN_ANY_VEHICLE, Game.PlayerPed, true);

                if (!isInVehicle)
                {
                    Function.Call(Hash.TASK_START_SCENARIO_IN_PLACE, Game.PlayerPed, emote.EmoteType, emote.IntValue, emote.BoolValue);
                    Screen.ShowNotification(emote.Description);
                }
                else
                {
                    Screen.ShowNotification(model.errorVehicle.ElementAt(model.language).title);
                }
            }
            else
            {
                Screen.ShowNotification(model.errorPlayerID.ElementAt(model.language).title);
            }
        }
        void PlayEmote(Emote emote)
        {
            if (Game.PlayerPed != null)
            {
                bool isInVehicle = Function.Call <bool>(Hash.IS_PED_IN_ANY_VEHICLE, Game.PlayerPed, true);

                if (!isInVehicle)
                {
                    Function.Call(Hash.TASK_START_SCENARIO_IN_PLACE, Game.PlayerPed, emote.EmoteType, emote.Delay, emote.PlayEnterAnim);
                    Screen.ShowNotification(emote.Description);
                }
                else
                {
                    Screen.ShowNotification(errors.ElementAt(0));
                }
            }
            else
            {
                Screen.ShowNotification(errors.ElementAt(2));
            }
        }