AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hookmenu (https://forums.alliedmods.net/showthread.php?t=11408)

nightscreem 03-18-2005 16:37

hookmenu
 
this is a plugin for hookmenu you can use it when you type amx_hookmenu in console and you will see a hookmenu
with all commands I only added 1 to see if it works but it doesn't so
plz help
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Hook Menu","1.0","[iwek]Nightscream")     register_concmd("amx_hook_on","cmdhook_on",ADMIN_MENU,"turns hookmod on and off")     register_menucmd(register_menuid("\yHookMenu"), 1023, "actionHookmenu")         return PLUGIN_CONTINUE } /*-------------------------------------Hook on--------------------------------------------------*/ public Hook_on() {     server_cmd("DF_hook_on") } /*-------------------------------------Main Menu------------------------------------------------*/ public actionHookmenu(id, key) {     switch(key) {         case 0: {             client_cmd(id, "amx_hookmenu")         }         case 2: {             client_cmd(id, "amx_hookmenu")             log_amx("[Hookmenu] ^"%s<%d><%s><>^" Turns Hook mod on and off", name, get_user_userid(id), authid)         }     }     return PLUGIN_HANDLED } public showHookmenu(id, level, cid) {     if (!cmd_access(id, level, cid, 1))     return PLUGIN_HANDLED     new menu[256]     format(menu, 255, "\yHookMenu^n^n\w1. turns hook on and off^n\w0. Exit")     show_menu(id, ((1<<0)|(1<<1)), menu)         return PLUGIN_HANDLED }

XxAvalanchexX 03-18-2005 20:37

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Hook Menu","1.0","[iwek]Nightscream")     register_concmd("amx_hook_on","cmdhook_on",ADMIN_MENU,"turns hookmod on and off")     register_menucmd(register_menuid("\yHookMenu"), 1023, "actionHookmenu")         return PLUGIN_CONTINUE } /*-------------------------------------Hook on--------------------------------------------------*/ // Don't need this! /*public Hook_on() {     server_cmd("DF_hook_on") }*/ /*-------------------------------------Main Menu------------------------------------------------*/ public actionHookmenu(id, key) {     switch(key) {         case 0: { // key 0 == number 1             set_cvar_num("DF_hook_on",1);             client_print(id,print_chat,"* HookMod is now on");         }         case 1: { // key 1 == number 2             set_cvar_num("DF_hook_on",0);             client_print(id,print_chat,"* HookMod is now off");         }     }     return PLUGIN_HANDLED } public showHookmenu(id, level, cid) {     if (!cmd_access(id, level, cid, 1))     return PLUGIN_HANDLED     new menu[256]     format(menu, 255, "\yHookMenu^n^n\w1. HookMod On^n\w2. HookMod Off^n^n\w0. Exit")     show_menu(id, MENU_KEY_1|MENU_KEY_2|MENU_KEY_0, menu)         return PLUGIN_HANDLED }

nightscreem 03-19-2005 11:06

the DF_hook_on is working but when i type amx_hookmenu and pick 1 or 2 it closes and when i type amx_hookonmenu and push 1 or 2 it works great but when I type amx_hookgroundmenu and push 1 or 2 it the menu closes
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Hook Menu","1.0","[iwek]Nightscream")     register_clcmd("amx_hookmenu","CmdHookMenu",ADMIN_MENU, "- Displays The hookmenu")     register_clcmd("amx_hookonmenu","CmdHookOnMenu",ADMIN_MENU,"- Displays the hook on and off menu")     register_clcmd("amx_hookgroundmenu","CmdHookGroundMenu",ADMIN_MENU,"- Displays the ground menu")     register_menucmd(register_menuid("Hook Menu"),1023,"actionHookmenu")     register_menucmd(register_menuid("Hook on and off Menu"),1023,"actionHookonmenu")     register_menucmd(register_menuid("Hook ground Menu"),1023,"actionHookgroundmenu")     return PLUGIN_CONTINUE } /*-------------------------------------Main Menu------------------------------------------------*/ public actionHookmenu(id, key) {     switch(key) {         case 0: {             client_cmd(id,"amx_hookonmenu")         }         case 1: {             client_cmd(id,"amx_hookgroundmenu")         }     }     return PLUGIN_HANDLED } public CmdHookMenu(id, level, cid) {     if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED           new menu[256]     format(menu, 255, "\yHookmod menu^n^n\w1. Hook on and off menu^n\w2. Hook ground menu^n\w0. Exit")     show_menu(id,((1<<0)|(1<<1)|(1<<2)), menu)           return PLUGIN_HANDLED } /*--------------------------------Hook on and off Menu------------------------------------------*/ public actionHookonmenu(id,key) {     switch(key) {         case 0: {             set_cvar_num("DF_hook_on",0);             client_print(id,print_chat,"[HookMod]hook is now off");         }         case 1: {             set_cvar_num("DF_hook_on",1);             client_print(id,print_chat,"[HookMod]hook is now on");         }     }     return PLUGIN_HANDLED } public CmdHookOnMenu(id, level, cid) {     if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED     new menu[256]     format(menu, 255, "\yHook on and off Menu^n^n\w1. Hook off^n\w2. Hook on^n\w3. Back^n\w0. Exit")     show_menu(id,((1<<0)|(1<<1)|(1<<9)), menu)           return PLUGIN_HANDLED } /*---------------------------------Hook ground Menu---------------------------------------------*/ public actionHookgroundmenu(id,key) {     switch(key) {         case 0: {             set_cvar_num("DF_hook_ground",0);             client_print(id,print_chat,"[HookMod]players can't attach hooks on the ground");         }         case 1: {             set_cvar_num("DF_hook_ground",1);             client_print(id,print_chat,"[HookMod]players can attach hooks on the ground");         }     }     return PLUGIN_HANDLED } public CmdHookGroundMenu(id, level, cid) {     if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED     new menu[256]     format(menu, 255, "\yHook Ground Menu^n^n\w1. Hook ground off^n\w2. Hook ground on^n\w3. Back^n\w0. Exit")     show_menu(id,((1<<0)|(1<<1)|(1<<9)), menu)           return PLUGIN_HANDLED }

nightscreem 03-20-2005 09:34

plz help
or say if you don't get my question :!:

nightscreem 03-26-2005 07:31

need help quik plz

v3x 03-26-2005 08:20

Stop spamming and be patient, "plz"..

nightscreem 03-26-2005 10:07

sry but no one want to help me so it was on the second page

nightscreem 04-03-2005 07:53

this isn't meant to be spam but common pls help i have another thing now not the whole menu but how can I make a menu that if you push the 1 key the command will get on if you push in the menu it will gives off
I hope you understand like in the statscfgmenu

v3x 04-03-2005 09:39

Example:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("My Menu", "0.1", "John Doe")     register_clcmd("say /menu", "showMenu",0, "Shows the menu for menu stuff")     register_menucmd(register_menuid("\yMy Menu:"), 1023, "myMenu")     return PLUGIN_CONTINUE } public showMenu(id) {     new szMenuBody[256]     new keys     new len = format(szMenuBody, 255, "\yMy Menu:^n")     len += format(szMenuBody[len], 255-len, "^n\w1. On")     len += format(szMenuBody[len], 255-len, "^n\w2. Off")     len += format(szMenuBody[len], 255-len, "^n^n\w0. Exit")     keys = (1<<0|1<<1|1<<9)         show_menu(id, keys, szMenuBody, -1)     return PLUGIN_CONTINUE } public myMenu(id, key) {     // Switch stuff ..     return PLUGIN_HANDLED }

nightscreem 04-03-2005 16:59

thx for helping but not what i meant
i mean something like this
http://www.geocities.com/claniwek/menu.JPG


All times are GMT -4. The time now is 14:05.

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