AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to link say commands to menus (https://forums.alliedmods.net/showthread.php?t=86832)

31m0_owns 03-03-2009 08:16

How to link say commands to menus
 
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwhich>
#define PLUGIN "elmos"
#define VERSION "1.0"
#define AUTHOR 31m0"
#define KeysItem Menu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4) // Keys: 12345

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /itemmenu","Give Item",ADMIN_ALL, "Gives someone and item")
register_menucmd(register_menuid("Item Menu"), KeysItem Menu, "PressedItem Menu")


}
public ShowItem Menu(id) {
show_menu(id, KeysItem Menu, "\r1. G\wrenade^n\r2. S\wmoke^n\r3. F\wlash^n\r4. M\w4^n\r5. A\wK^n", -1, "Item Menu") // Display menu
}
public PressedItem Menu(id, key) {
/* Menu:
* 1. Grenade
* 2. Smoke
* 3. Flash
* 4. M4
* 5. AK
*/
switch (key) {
case 0: { // 1

}
case 1: { // 2

}
case 2: { // 3

}
case 3: { // 4

}
case 4: { // 5

}
}
}

rufee 03-03-2009 08:28

Re: How to link say commands to menus
 
if i understood what you want
PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwhich>
#define PLUGIN "elmos"
#define VERSION "1.0"
#define AUTHOR 31m0"
#define KeysItem Menu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4) // Keys: 12345
 
public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd("say /itemmenu","Give Item",ADMIN_ALL"Gives someone and item")
register_menucmd(register_menuid("Item Menu"), KeysItem Menu"PressedItem Menu")
 
 
}
public 
ShowItem Menu(id) {
show_menu(idKeysItem Menu"\r1. G\wrenade^n\r2. S\wmoke^n\r3. F\wlash^n\r4. M\w4^n\r5. A\wK^n", -1"Item Menu"// Display menu
}
public 
PressedItem Menu(idkey) {
/* Menu:
* 1. Grenade
* 2. Smoke
* 3. Flash
* 4. M4
* 5. AK
*/
switch (key) {
case 
0: { client_print(0,print_chat,"Your text"player_name)
 
}
case 
1: { client_print(0,print_chat,"Your text"player_name)
 
}
case 
2: { client_print(0,print_chat,"Your text"player_name)
 
}
case 
3: { client_print(0,print_chat,"Your text"player_name)
 
}
case 
4: { client_print(0,print_chat,"Your text"player_name)
 
}
}



31m0_owns 03-03-2009 15:42

Re: How to link say commands to menus
 
I think the code works... but when i compile it says cannot not read from file hamsandwhich

Starsailor 03-03-2009 18:34

Re: How to link say commands to menus
 
1 Attachment(s)
you dont have hamsandwich.inc in your include folder

IneedHelp 03-03-2009 18:35

Re: How to link say commands to menus
 
.....

#include <hamsandwhich>

-->

#include <hamsandwich>


All times are GMT -4. The time now is 17:03.

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