AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with custom menu for gathers...... (https://forums.alliedmods.net/showthread.php?t=56439)

Qlim4X 06-13-2007 21:04

help with custom menu for gathers......
 
5 Attachment(s)
hi again

i want to make a custom game menu for mxd - gather games

i made the plugins that i want and i want to put them in a custom menu...

the custom plugins are

LIVE GAME
IRC NICKS TEAMS
WARM UP
PLANS POSSITIONS
RESTART SERVER

and the stadar are

amx_pause
amx_kickmenu
amx_slapmenu
amx_mapmenu



and the menu code is this on


Code:

/* AMX Mod script.
*
* (c) 2007, Qlim4X
* This file is provided as is (no warranties).
*
*  Generated by AMX MenuMaker v1.5 (http://sniperbeamer.amxmod.info)
*/

#include <amxmod>
#include <amxmisc>



public plugin_init()
{
 register_plugin("ProGather Menu","1.0","Qlim4X")

 register_menucmd(register_menuid("ProGather Menu"),1023,"actionMenu")
 register_clcmd("amx_promenu","showMenu",ADMIN_MENU,"gather menu")

 new modName[32]
 get_modname(modName,31)
 
}

public actionMenu(id,key)
{
 switch(key){
 case 0:{
    server_cmd("amx_pause")
    PLUGIN_CONTINUE
 }
 case 1:{
    server_cmd("pro_warmup")
 }
 case 2:{
    server_cmd("pro_nicks")
 }
 case 3:{
    server_cmd("pro_plans")
 }
 case 4:{
    server_cmd("pro_live")
 }
 case 5:{
    server_cmd("amx_rr 1 1")
 }
 case 6:{
    server_cmd("amx_slapmenu")
 }
 case 7:{
    server_cmd("amx_kickmenu")
 }
 case 8:{
    server_cmd("amx_mapmenu")
 }
 }

 return PLUGIN_HANDLED
}

public showMenu(id,level,cid)
{
 if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED

 new menuBody[512]
 new keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
 new len = format(menuBody,511,"\yProGather Menu\R^n\" )
 len += format( menuBody[len], 511-len, "^n\w1. Pause Server" )
 len += format( menuBody[len], 511-len, "^n\w2. Warmup Time" )
 len += format( menuBody[len], 511-len, "^n\w3. Nicks And Teams" )
 len += format( menuBody[len], 511-len, "^n\w4. Plans & Poss" )
 len += format( menuBody[len], 511-len, "^n\w5. LIVE GO GO GO" )
 len += format( menuBody[len], 511-len, "^n\w6. Restart" )
 len += format( menuBody[len], 511-len, "^n\w7. Slap Menu" )
 len += format( menuBody[len], 511-len, "^n\w8. Kick Menu" )
 len += format( menuBody[len], 511-len, "^n\w9. Map Menu" )
 len += format( menuBody[len], 511-len, "^n^n\w0. Exit" )
 
 show_menu( id, keys, menuBody, -1 )

 return PLUGIN_HANDLED
}

how can expand the menu in pages?
how can i make the menu do not close after a selection

the comands 2,3,4,6,7,8,9 doesnt play....

Qlim4X 06-14-2007 07:48

Re: help with custom menu for gathers......
 
i fix the code so all the commands will work....

now i want to make the menu after some commands to be open and not closing...

what can i do???


the full script

Code:

/* AMX Mod script.
*
* (c) 2007, Qlim4X
* This file is provided as is (no warranties).
*
*  Generated by AMX MenuMaker v1.5 (http://sniperbeamer.amxmod.info)
*/

#include <amxmod>
#include <amxmisc>


public plugin_init()
{
 register_plugin("ProGather Menu","1.0","Qlim4X")

 register_menucmd(register_menuid("ProGather Menu"),1023,"actionMenu")
 register_clcmd("amx_promenu","showMenu",ADMIN_KICK,"gather menu")

 new modName[32]
 get_modname(modName,31)
 
}

public actionMenu(id,key)
{
 switch(key){
 case 0:{
    server_cmd("amx_pause")
 }
 case 1:{
    client_cmd(id,"pro_warmup")
 }
 case 2:{
    client_cmd(id,"pro_nicks")
 }
 case 3:{
    client_cmd(id,"pro_plans")
 }
 case 4:{
    client_cmd(id,"pro_live")
 }
 case 5:{
    server_cmd("amx_rr 1 1")
 }
 case 6:{
    client_cmd(id,"amx_slapmenu")
 }
 case 7:{
    client_cmd(id,"amx_kickmenu")
 }
 case 8:{
    client_cmd(id,"amx_mapmenu")
 }
 }

 return PLUGIN_HANDLED
}

public showMenu(id,level,cid)
{
 if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
 new menuBody[1024]
 new keys
 keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
 new len = format(menuBody,1511,"\yProGather Menu\R^n^n\" )
 len += format( menuBody[len], 1024-len, "^n\w1. Pause Server" )
 len += format( menuBody[len], 1024-len, "^n\w2. Warmup Time" )
 len += format( menuBody[len], 1024-len, "^n\w3. Nicks And Teams" )
 len += format( menuBody[len], 1024-len, "^n\w4. Plans & Poss" )
 len += format( menuBody[len], 1024-len, "^n\w5. LIVE GO GO GO" )
 len += format( menuBody[len], 1024-len, "^n\w6. Restart" )
 len += format( menuBody[len], 1024-len, "^n\w7. Slap Menu" )
 len += format( menuBody[len], 1024-len, "^n\w8. Kick Menu" )
 len += format( menuBody[len], 1024-len, "^n\w9. Map Menu" )
 len += format( menuBody[len], 1024-len, "^n^n\w0. Exit" )
 
 show_menu( id, keys, menuBody, -1 )

 return PLUGIN_CONTINUE
}


[X]-RayCat 06-14-2007 09:33

Re: help with custom menu for gathers......
 
Quote:

Originally Posted by Qlim4X (Post 489560)
i fix the code so all the commands will work....

now i want to make the menu after some commands to be open and not closing...

what can i do???


the full script

Code:

/* AMX Mod script.
*
* (c) 2007, Qlim4X
* This file is provided as is (no warranties).
*
*  Generated by AMX MenuMaker v1.5 (http://sniperbeamer.amxmod.info)
*/
 
#include <amxmod>
#include <amxmisc>
 
 
public plugin_init()
{
 register_plugin("ProGather Menu","1.0","Qlim4X")
 
 register_menucmd(register_menuid("ProGather Menu"),1023,"actionMenu")
 register_clcmd("amx_promenu","showMenu",ADMIN_KICK,"gather menu")
 
 new modName[32]
 get_modname(modName,31)
 
}
 
public actionMenu(id,key)
{
 switch(key){
 case 0:{
    server_cmd("amx_pause")
 }
 case 1:{
    client_cmd(id,"pro_warmup")
 }
 case 2:{
    client_cmd(id,"pro_nicks")
 }
 case 3:{
    client_cmd(id,"pro_plans")
 }
 case 4:{
    client_cmd(id,"pro_live")
 }
 case 5:{
    server_cmd("amx_rr 1 1")
 }
 case 6:{
    client_cmd(id,"amx_slapmenu")
 }
 case 7:{
    client_cmd(id,"amx_kickmenu")
 }
 case 8:{
    client_cmd(id,"amx_mapmenu")
 }
 }
 
 return PLUGIN_HANDLED
}
 
public showMenu(id,level,cid)
{
 if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
 new menuBody[1024]
 new keys
 keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
 new len = format(menuBody,1511,"\yProGather Menu\R^n^n\" )
 len += format( menuBody[len], 1024-len, "^n\w1. Pause Server" )
 len += format( menuBody[len], 1024-len, "^n\w2. Warmup Time" )
 len += format( menuBody[len], 1024-len, "^n\w3. Nicks And Teams" )
 len += format( menuBody[len], 1024-len, "^n\w4. Plans & Poss" )
 len += format( menuBody[len], 1024-len, "^n\w5. LIVE GO GO GO" )
 len += format( menuBody[len], 1024-len, "^n\w6. Restart" )
 len += format( menuBody[len], 1024-len, "^n\w7. Slap Menu" )
 len += format( menuBody[len], 1024-len, "^n\w8. Kick Menu" )
 len += format( menuBody[len], 1024-len, "^n\w9. Map Menu" )
 len += format( menuBody[len], 1024-len, "^n^n\w0. Exit" )
 
 show_menu( id, keys, menuBody, -1 )
 
 return PLUGIN_CONTINUE
}


Use new style menus or something else, but dont use menumaker it just sucks. Look Emps tutorial in 'Tutorials/code snippets' section.


All times are GMT -4. The time now is 10:43.

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