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

The command doesn't brings up the menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Andriis
Member
Join Date: May 2019
Old 05-10-2019 , 13:01   The command doesn't brings up the menu
Reply With Quote #1

So I made an "admin menu", which is very simple but i'm having a problem with this.. When I type in the command, it does nothing.. But there is nothing wrong with it

Here is the code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Admin Rendszer"
#define VERSION "1.0"
#define AUTHOR "Andriis"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /thsadminmenu", "ths_admin_menu", ADMIN_KICK, "")
}

public ths_admin_menu(id, lvl, cid)
{
	if(!cmd_access(id, lvl, cid, 0))
		return PLUGIN_HANDLED;

	new menu = menu_create("Admin Menü", "admin_menu_handler");

	menu_additem(menu, "Büntetés menü", "0", 0);
	menu_additem(menu, "Unban menü", "1", 0); 
	menu_additem(menu, "Csapatváltás", "2", 0);
	menu_additem(menu, "Ütögetés/Megölés", "3", 0);
	menu_additem(menu, "Pályaváltás", "4", 0); 
	menu_additem(menu, "Pálya szavaztatása", "5", 0);
	menu_additem(menu, "Kör újraindítása", "6", 0);
	menu_additem(menu, "Teleportálás", "7", 0);

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_setprop(menu, MPROP_PERPAGE, 8);
	menu_setprop(menu, MPROP_BACKNAME, "Vissza");
	menu_setprop(menu, MPROP_NEXTNAME, "Következő");
	menu_setprop(menu, MPROP_EXITNAME, "Kilépés");

	menu_display(id, menu, 0);

	return PLUGIN_HANDLED;
}

public admin_menu_handler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_cancel(id);
		return PLUGIN_HANDLED;
	}

	new command[6], name[64], access, callback;

	menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

	switch(item)
	{
		case 0:{
			client_print(id, print_chat, "asd");
		}
		case 1: {
			client_print(id, print_chat, "asd");
		}
		case 2: {
			console_cmd(id, "amx_teammenu", 0);
		}
		case 3: {
			console_cmd(id, "amx_slapmenu", 0);
		}
		case 4: {
			console_cmd(id, "amx_mapmenu", 0);
			}
		case 5: {
			console_cmd(id, "amx_votemapmenu", 0);
			}
		case 6: {
			console_cmd(id, "amx_cmdmenu", 0);
			}
		case 7: {
			console_cmd(id, "amx_teleportmenu", 0);
			}
	}

	menu_destroy(menu);

	return PLUGIN_HANDLED;
}
I don't know what is wrong with this..
Thanks in advance..

Last edited by Andriis; 05-10-2019 at 13:02.
Andriis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-10-2019 , 17:29   Re: The command doesn't brings up the menu
Reply With Quote #2

Look at the error log that's showing when you use the command. It's pretty self-explanatory.
__________________

Last edited by OciXCrom; 05-10-2019 at 17:29.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Andriis
Member
Join Date: May 2019
Old 05-11-2019 , 06:39   Re: The command doesn't brings up the menu
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Look at the error log that's showing when you use the command. It's pretty self-explanatory.
But it says nothing :/
Andriis is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-11-2019 , 14:51   Re: The command doesn't brings up the menu
Reply With Quote #4

You must be looking at the wrong file. It does create an error in the error logs. If you run it today the log file is:
<mod>\addons\amxmodx\logs\error_20190511.lo g
__________________

Last edited by fysiks; 05-11-2019 at 14:52.
fysiks is offline
Andriis
Member
Join Date: May 2019
Old 05-11-2019 , 16:54   Re: The command doesn't brings up the menu
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
You must be looking at the wrong file. It does create an error in the error logs. If you run it today the log file is:
<mod>\addons\amxmodx\logs\error_20190511.lo g
Seriously it says nothing
Andriis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-11-2019 , 18:16   Re: The command doesn't brings up the menu
Reply With Quote #6

But it does:

PHP Code:
L 05/10/2019 23:28:53Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190510.log")
L 05/10/2019 23:28:53Cannot set 8 items per page
L 05
/10/2019 23:28:53: [AMXXDisplaying debug trace (plugin "test.amxx"version "1.0")
L 05/10/2019 23:28:53: [AMXXRun time error 10native error (native "menu_setprop")
L 05/10/2019 23:28:53: [AMXX]    [0test.sma::ths_admin_menu (line 31
You need to learn to look at these errors if you're going to create plugins. They can tell you quite a lot.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Andriis
Member
Join Date: May 2019
Old 05-12-2019 , 04:16   Re: The command doesn't brings up the menu
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
But it does:

PHP Code:
L 05/10/2019 23:28:53Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190510.log")
L 05/10/2019 23:28:53Cannot set 8 items per page
L 05
/10/2019 23:28:53: [AMXXDisplaying debug trace (plugin "test.amxx"version "1.0")
L 05/10/2019 23:28:53: [AMXXRun time error 10native error (native "menu_setprop")
L 05/10/2019 23:28:53: [AMXX]    [0test.sma::ths_admin_menu (line 31
You need to learn to look at these errors if you're going to create plugins. They can tell you quite a lot.
Well.. For me it's still says nothing, but thanks to you now it works.. Thank you so much ^^
Andriis is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-12-2019 , 06:48   Re: The command doesn't brings up the menu
Reply With Quote #8

L 05/10/2019 - 23:28:53: Cannot set 8 items per page
How is that nothing?
__________________

Last edited by HamletEagle; 05-12-2019 at 06:48.
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2019 , 16:47   Re: The command doesn't brings up the menu
Reply With Quote #9

Quote:
Originally Posted by Andriis View Post
Well.. For me it's still says nothing, but thanks to you now it works.. Thank you so much ^^
Does the file exist? If not, that's different than "it still says nothing". Also, do any files exist in the "<mod>\addons\amxmodx\logs" folder? If not then maybe there is a permissions issue with that folder.
__________________

Last edited by fysiks; 05-12-2019 at 16:48.
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 08:45.


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