Raised This Month: $32 Target: $400
 8% 

[HELP] Client Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 11-13-2018 , 12:12   [HELP] Client Menu
Reply With Quote #1

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_cmdADMFLAG_ROOT"Perms Menu Command");
    
CreatePermsMenu();
    
CreateClientMenu();
}

public 
Action perm_cmd(int clientint args)
{
    
CreateClientMenu().Display(clientMENU_TIME_FOREVER); /* all clients in game */
    
CreatePermsMenu();
}

public 
Action CreateClientMenu()
{
    
Menu ccm = new Menu(handler2MENU_ACTIONS_ALL);
    
ccm.SetTitle("All Clients Name Menu");
    
ccm.ExitButton true;
        
/* Other part of code im asking */
}

public 
Action CreatePermsMenu()
{
    
Menu cpm = new Menu(handler1MENU_ACTIONS_ALL);
    
cpm.SetTitle("Permissions Menu");
    
cpm.AddItem("vip""VIP");
    
cpm.ExitBackButton true;
    
cpm.ExitButton true;
    
    return 
cpm;
}

public 
int handler1(Menu cpmMenuAction actionint 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(itemchoicesizeof(choice));
    if (
action == MenuAction_Select)
    {
        if (
StrEqual(choice"vip"))
        {
            
AddUserFlags(clientADMFLAG_CUSTOM1);
            
PrintToChat(client"Congrats! VIP was given to %s !"clientname);
        }
    }
    else if (
action == MenuAction_Cancel)
    {
        
delete cpm;
        
CreateClientMenu().Display(clientMENU_TIME_FOREVER);
    }
    else if (
action == MenuAction_End)
    {
        
delete cpm;
    }
}

public 
int handler2(Menu ccmMenuAction actionint 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!
__________________
SpirT is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode