all-in-simplicity / fivem-hypnonema

Media Player Resource for FiveM
Other
140 stars 73 forks source link

Bring back default screen volume and create ace permision for command #100

Open Deniel00 opened 2 years ago

Deniel00 commented 2 years ago

Hi!

Screen default volume Please give back screen default volume, some screen (like in gym) want use, but only low volume. Working idea: can give volume on screen create/edit, but while player using hypnonema volume xx command this will calculate screen volume for correct volume. Volume calculating: Volume = ScreenVol * (PlayerVol / 100)

Permission for NUI open Please create Ace Permission for hypnonema command. We are not want allowing hypnonema command for players, but currently can't disable it, because not implement any ace permission for command. I'm think only need permission check for Hypnonema.Client/ClientScript.cs#L94 like:

        private void OnCommand(int source, List<object> args, string raw)
        {
                if (args.Count == 0)
                {
                        // no arguments provided. show nui window
                        if (API.IsAceAllowed(Permission.OpenNui)) {
                                ShowUI(true);
                                this.screenStorageManager.GetScreenList.InvokeNoArgs();
                        }else{
                                //no permission message.
                        }

                        return;
                }