Raised This Month: $51 Target: $400
 12% 

Get Client Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 11-11-2018 , 11:46   Get 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
wilianmaique
BANNED
Join Date: Nov 2016
Old 11-11-2018 , 11:57   Re: Get Client Menu
Reply With Quote #2

Wrong forum, friend.
wilianmaique is offline
Send a message via Skype™ to wilianmaique
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 11-11-2018 , 17:06   Re: Get Client Menu
Reply With Quote #3

Quote:
Originally Posted by wilianmaique View Post
Wrong forum, friend.
This forum is for Scripting Help so i'm asking help do yeah correct forum. If im not correct say me whats the correct forum...
__________________
SpirT is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 11-11-2018 , 17:42   Re: Get Client Menu
Reply With Quote #4

This is Amxmodx section.

https://forums.alliedmods.net/forumdisplay.php?f=52
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 11-12-2018 , 16:17   Re: Get Client Menu
Reply With Quote #5

Quote:
Originally Posted by SomewhereLost View Post
ohhh yeah. Sorry. Thanks for the warning.
__________________
SpirT is offline
Reply



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 18:51.


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