Jump to content

/rules force

Closed 0.1.4 0.1.5

ffriozi
  • in Rules
ffriozi

Posted (edited)

Hello, its possible to force the rules again for a specific player?

thanks for the plugin.

Edited by ffriozi
IIIaKa

Posted

@ffriozi
Hello, at the moment, there is only the option to request consent from all players at once.
However, I will definitely try to add the ability to request consent from a specified player. Thank you for the suggestion.

  • Like 1
ffriozi

Posted

H

On 10/31/2024 at 11:44 AM, IIIaKa said:

@ffriozi
Hello, at the moment, there is only the option to request consent from all players at once.
However, I will definitely try to add the ability to request consent from a specified player. Thank you for the suggestion.

Hello, I ended up making some crude modifications, but the result was close to what I expected. In this case, I created a /rulesagain command that displays the rules panel again without checking if the player has already read it before. I'll share the code in case you want to implement it and improve it. Thank you!

 

// after ShowRules
private void ShowRulesAlways(BasePlayer player)
        {
            if (!_storedData.PlayersData.TryGetValue(player.UserIDString, out var playerData) || (!_config.EveryTime && playerData.LastAgree > _lastUpdate)) ;
            
            DestroyPanel(player);
            CuiHelper.AddUi(player, _cached_MainPanel);
            CuiHelper.AddUi(player, _cached_PanelSubElements
                .Replace(Placeholders_TitleText, lang.GetMessage("PanelTitle", this, player.UserIDString))
                .Replace(Placeholders_TitleSubText, string.Format(lang.GetMessage("PanelLastUpdate", this, player.UserIDString), lang.GetMessage(_lastUpdate.ToString("MMMM"), this, player.UserIDString), _lastUpdate.Day, _lastUpdate.Year))
                .Replace(Placeholders_DeclineBtnText, $"{lang.GetMessage("BtnDecline", this, player.UserIDString)}{(_config.RejectionsToBan > 0 ? string.Format($"({_config.RejectionsToBan - playerData.Declines})") : string.Empty)}")
                .Replace(Placeholders_AcceptBtnText, lang.GetMessage("BtnAccept", this, player.UserIDString)));
            
            _awaitingPlayers.Add(player.UserIDString, null);
            if (_awaitingPlayers.Count == 1)
            DrawContent(player, playerData);

        }



//AddCovalenceCommand
private void Init()
{
    AddCovalenceCommand("rulesagain", nameof(RulesShowAlways_Command)); // Novo comando
}



// commands section
private void RulesShowAlways_Command(IPlayer player, string command, string[] args)
{
    if (player.Object is BasePlayer basePlayer)
    {
        ShowRulesAlways(basePlayer);
        player.Reply("Regras sendo exibidas.");
    }
}

 

IIIaKa

Posted

Changed Status from Pending to Work in Progress

IIIaKa

Posted

@ffriozi
Hello.
In the next update, using the command /rules show will forcibly display the rules.
Additionally, admins will have the option to specify a player with /rules show *userNameOrId*

IIIaKa

Posted

Changed Status from Work in Progress to Closed

Changed Fixed In to Next Version

IIIaKa

Posted

If the issue persists, feel free to report it in this thread.

  • Like 1
ffriozi

Posted (edited)

Hello thanks for this!

but i have some problems;

/rules reask (dont have any effect)

/rules show "steamid" (dont matter what steamID or name the rules is showed only for the admin that used the command)

Edited by ffriozi
  • Like 1
1.7m

Downloads

Total number of downloads.

7.9k

Customers

Total customers served.

119.1k

Files Sold

Total number of files sold.

2.4m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.