forked from TFC-Developers/sw_base_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SW_MENU.sma
40 lines (36 loc) · 1.1 KB
/
SW_MENU.sma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "include/global"
#include "include/api_thirdperson"
public plugin_init() {
RegisterPlugin
register_clcmd "say menu", "cmd_menu"
register_clcmd "say /menu", "cmd_menu"
}
public plugin_natives() {
register_library "sw_menu"
register_native "open_menu", "Native_OpenMenu"
}
public cmd_menu(id) {
open_menu id
return PLUGIN_HANDLED
}
public Native_OpenMenu(iPlugin, iParams) {
open_menu(get_param(1))
}
public open_menu(id) {
console_print id, "Showing menu"
new menu = menu_create("Menu", "menu_handler")
menu_additem menu, "Toggle third person mode", "menu_third_person"
menu_additem menu, "Nominate map", "menu_nominate"
menu_additem menu, "Choose custom model", "menu_choose_model"
menu_additem menu, "Model showcase", "menu_model_showcase"
menu_additem menu, "Toggle visibility of custom models", "menu_toggle_custom_models"
menu_additem menu, "Enlighten me!", "menu_enlighten"
menu_display id, menu, 0
}
public menu_handler(id, menu, item) {
switch (item) {
case 0: thirdperson id
case 5: set_pev id, pev_effects, pev(id, pev_effects) ^ EF_BRIGHTLIGHT
}
menu_destroy menu
}