Hello, what I need is to set it to show the rules to the players, for example if I set !showmodes "player name", for example !showmodes shadowspecter, it will show the rules panel.
The plugin works correctly if I put !modes, it shows me the rules panel, but what I want to incorporate is for an admin to put !showmodes and show it to other players instead of himself.
If someone can help me with this it would be very helpful, I tried many times to do it but I could not achieve it, I also did it with the support of other plugins but not either.
Code:
public void OnPluginStart()
{
CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
//RegConsoleCmd("sm_modes", modes);
//RegConsoleCmd("sm_mode", modes);
RegConsoleCmd("sm_mode", modes);
RegConsoleCmd("sm_modes", modes);
}
public Action modes(int client, int args).
{
Menu menu = new Menu(Menu_Callback);
menu.SetTitle("Rules by modes:");
menu.AddItem("option0", "Jailbreak Rules");
menu.AddItem("option1", "TTT Rules");
menu.AddItem("option2", "Complete Rules");
menu.ExitButton = true;
menu.Display(client, 30);
return Plugin_Handled;
}
public int Menu_Callback(Menu menu menu, MenuAction action, int client, int param)
{
switch (action)
{
case MenuAction_Select:
{
char item[32];
menu.GetItem(param, item, item, sizeof(item));
if (StrEqual(item, "option0"))
{
MenuRulesJail(client);
}
if (StrEqual(item, "option1"))
{
MenuRulesTTT(client);
}
} if (StrEqual(item, "option2"))
{
PrintToChat(client, ">>>>x04[\x02LINK\x04] \x10https:LINK LINK");
}
}
case MenuAction_End:
{
delete menu;
}
}
}
menu MenuRulesJail(int client)
{
Panel panel = new Panel();
panel.SetTitle("Basic Jailbreak Rules:");
panel.DrawText("1. You must obey the captain at all times or you may rebel");
panel.DrawText("2. You can use the !awards command to buy skills");
panel.DrawText("3. In case you get killed wrongly type !fk to report it.");
panel.DrawText("4. You can't date allies by microphone or chat");
panel.DrawText(">>To read the complete rules enter the steam group<<");
panel.DrawItem("- Accept");
panel.Send(client, RulesHandler, MENU_TIME_FOREVER);
}
Menu MenuRulesTTT(int client).
{
Panel panel = new Panel();
panel.SetTitle("Basic TTT Rules:");
panel.DrawText("How to know if you are a traitor, innocent or detective?");
panel.DrawText("1. If you are a TRAITOR you get a red T at the top right");
panel.DrawText("2. If you are INNOCENT you get a green I at the top right");
panel.DrawText("3. If you are DETECTIVE you get a blue D at the top right");
panel.DrawText("4. The traitor must kill all those who do not have a red aura");
panel.DrawText("5. The innocent must survive or help the detective find the traitor.");
panel.DrawText("6. The detective must find the traitor and kill him before the traitor kills everyone.");
panel.DrawItem("- Accept");
panel.Send(client, RulesHandler, MENU_TIME_FOREVER);
}
public int RulesHandler(Menu menu, MenuAction action, int p1, int p2) {
}