Raised This Month: $ Target: $400
 0% 

[REQ] Name , command, access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JohnBloper
Member
Join Date: Jul 2014
Old 08-06-2014 , 15:33   [REQ] Name , command, access
Reply With Quote #1

I have a menu that is only for admins. and i want if a reg player name is "JohnBP" and he types in chat the command "21313"
then he can access then menu? but it wont auto open the menu. It will just open the menu when he types the command.

Last edited by JohnBloper; 08-06-2014 at 15:55.
JohnBloper is offline
Decak
Senior Member
Join Date: Sep 2012
Old 08-06-2014 , 17:18   Re: [REQ] Name , command, access
Reply With Quote #2

Like this? When you type '21313' , you get acces for open Menu.Code:

Code:
#include <amxmodx>
#include <amxmisc>

new bool:actived[33];
new PSaid[33] = "21313";

public plugin_init() {
    register_plugin("allied", "1.0", "DecaK")
    register_clcmd("say", "sayche")
    register_clcmd("say /menu", "Menu")
}

public client_connect(id) {
    actived[id] = false;
}

public sayche(id) {
    new said[192], saiid, PSaiid;
    read_args(said,191)
    remove_quotes(said)
    PSaiid = str_to_num(PSaid);
    saiid = str_to_num(said);
    if(saiid == PSaiid) {
    actived[id] = true;
    return PLUGIN_HANDLED;
}
    return PLUGIN_CONTINUE;
}

public Menu(id) {
    if(actived[id]) {
    new menu = menu_create("Shop", "MenuHandle")
    menu_additem(menu, "Item 1")
    menu_additem(menu, "Item 2")
    menu_display(id, menu)
    return PLUGIN_HANDLED;
}
    client_print(id, print_chat, "[AMXX] You dont have acces!")
    return PLUGIN_HANDLED;
}

public MenuHandle(id, menu, item) {
    if(item == MENU_EXIT) {
    menu_destroy(menu)
    return PLUGIN_HANDLED;
}
    switch(item) {
    case 1: {
    // Code
}
    case 2: {
    // Code
}
}
    return PLUGIN_CONTINUE;
}
Decak is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-06-2014 , 17:23   Re: [REQ] Name , command, access
Reply With Quote #3

Quote:
Originally Posted by JohnBloper View Post
I have a menu that is only for admins. and i want if a reg player name is "JohnBP" and he types in chat the command "21313"
then he can access then menu? but it wont auto open the menu. It will just open the menu when he types the command.
You haven't given enough details about what you want your "menu" to do. You should attach your plugin and also explain (without any code) what you want to happen in as much detail as possible.
__________________

Last edited by fysiks; 08-06-2014 at 17:23.
fysiks 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 07:49.


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