View Single Post
Author Message
wEight
BANNED
Join Date: Jan 2015
Old 01-13-2015 , 18:04   [Help] print_chat menu?
Reply With Quote #1

So i was working on a plugin where you select an option from the menu, a message will print on your chat for example: When you select option one in the menu a message diplays in your chat.

So i scripted this in the code box and it wont work, do i have to add something else or what is it?
Ingame the menu displays but the message doesn't when i select one option in the menu

Here's my script:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Ads Menu"
#define VERSION "1.0"
#define AUTHOR "wEight"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /ads", "menu", ADMIN_LEVEL_C)
}
public menu(id)
{
new menu = menu_create("\rAds \yby wEight", "menu_handler")
//Menu items
menu_additem(menu, "Adsample1", "1", 0)
menu_additem(menu, "Adsample2", "2", 0)
menu_additem(menu, "Adsample3", "3", 0)
menu_additem(menu, "Adsample4", "4", 0)
menu_additem(menu, "Adsample5", "5", 0)
menu_additem(menu, "Adsample6", "6", 0)
menu_display(id, menu, 0)
}
public menu_handler(id, menu, item)  
//Chat prints
{
	new data[7];
        new Key = str_to_num(data);
	switch (Key)
	{
		case 1:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}

		case 2:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}

		case 3:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}

		case 4:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}

		case 5:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}
		
		case 6:
		{
			client_print(id, print_chat, "Example AD")
			client_print(id, print_center, "Look at your chat!")
		}
	}
}

Last edited by wEight; 01-13-2015 at 18:06.
wEight is offline