So hi guys. Today i need a help. I'm doing something for my community and its a very important thing.
I wanna give a client VIP permissions (only root admins can do it) on a menu. I already done this
PHP Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "SpirTBBX"
#define PLUGIN_VERSION "1.0.0"
#include <sourcemod>
#include <sdktools>
#pragma newdecls required
public Plugin myinfo =
{
name = "VIP Permissions",
author = PLUGIN_AUTHOR,
description = "Root can give VIP permission to client in game",
version = PLUGIN_VERSION,
url = ""
};
public void OnPluginStart()
{
RegAdminCmd("sm_perm", perm_cmd, ADMFLAG_ROOT, "Perms Menu Command");
CreatePermsMenu();
CreateClientMenu();
}
public Action perm_cmd(int client, int args)
{
CreateClientMenu().Display(client, MENU_TIME_FOREVER); /* all clients in game */
CreatePermsMenu();
}
public Action CreateClientMenu()
{
Menu ccm = new Menu(handler2, MENU_ACTIONS_ALL);
ccm.SetTitle("All Clients Name Menu");
ccm.ExitButton = true;
/* Other part of code im asking */
}
public Action CreatePermsMenu()
{
Menu cpm = new Menu(handler1, MENU_ACTIONS_ALL);
cpm.SetTitle("Permissions Menu");
cpm.AddItem("vip", "VIP");
cpm.ExitBackButton = true;
cpm.ExitButton = true;
return cpm;
}
public int handler1(Menu cpm, MenuAction action, int client /* param1 */, int item /* param2 */)
{
char choice[32]; /* on client select on menu (variable) */
char clientname[32]; /* client who the flag was give */
cpm.GetItem(item, choice, sizeof(choice));
if (action == MenuAction_Select)
{
if (StrEqual(choice, "vip"))
{
AddUserFlags(client, ADMFLAG_CUSTOM1);
PrintToChat(client, "Congrats! VIP was given to %s !", clientname);
}
}
else if (action == MenuAction_Cancel)
{
delete cpm;
CreateClientMenu().Display(client, MENU_TIME_FOREVER);
}
else if (action == MenuAction_End)
{
delete cpm;
}
}
public int handler2(Menu ccm, MenuAction action, int client /* param1 */, int item /* param2 */)
{
char choice[32];
/* Other part of code im asking */
}
Can someone do the menu for me with the clients in game?
And obviously check if all the other things are correct.
Then reply when its done or PM me the code!
Thanks for the attention!
__________________