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!")
}
}
}