Raised This Month: $ Target: $400
 0% 

get_user_menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Nostrodamous
BANNED
Join Date: Oct 2006
Old 10-16-2006 , 20:16   Re: get_user_menu
Reply With Quote #3

no i know how to make menus im not a noob. Let me explaine further . I have a menu that will dispaly 2 options , practice or die. the menus works both options work , but i want to make it so that if the player doesnt choose , for instance if he jsut lets the menu go away and doesnt choose , then i want him to die also. so get_user_menu returns 0 if the player is not looking at a menu (ie he let the menu go away) . but i cant seem to get the paramters right . let me show u my code so far
Code:
/* This Plugin Is To Initiaite A Practice Mode Within Your Server , With Any weapon you wish to use . */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta_util> new keys = MENU_KEY_1 | MENU_KEY_2 ; new menu[192]; public plugin_init() {  register_plugin("practice_mod" , "1.5" , "Nas");  register_cvar("amx_practice" , "1"); /* Menus    */  register_menucmd(register_menuid("type_menu"),1023, "type_show");  register_menucmd(register_menuid("ak_menu"),1023, "ak_show");  register_menucmd(register_menuid("m4_menu"), 1023, "m4_show");  register_menucmd(register_menuid("galil_menu"), 1023 , "galil_show");  register_menucmd(register_menuid("aug_menu"), 1023 , "aug_show"); /* Commands */  register_concmd("amx_practice" , "type_menu", ADMIN_CVAR, "Shows The Practice Menu"); } public type_menu(id) {  format(menu, 191, "[Practice]^n1. Rifles^n2. SMG's^n3. Pistol's^n4. Nades^n^n0: Exit" );  show_menu(0 , keys, menu, -1, "type_menu")  return PLUGIN_CONTINUE; } public type_show(id) { } public ak_menu(id) {  if(get_cvar_num("amx_practice")==0)  {   return PLUGIN_HANDLED;  }  else  {   format(menu, 191, "Ready For Ak Practice?^n1. Practice^2. Die" );   show_menu(0 , keys, menu, -1, "ak_menu")   return PLUGIN_CONTINUE;  }  return PLUGIN_CONTINUE; }   public ak_show(id, key) {  if(key == 0)  // yes  {   fm_give_item(id, "weapon_ak47");   cs_set_user_bpammo(id , CSW_AK47 , 200);  }  else  {   if(key == 2)   {    user_kill(id);   }   else   {    if(get_user_menu(id)==0)    {     user_kill(id);    }   }  }  return PLUGIN_CONTINUE; }     public m4_menu(id) {  if(get_cvar_num("amx_practice")==0)  {   return PLUGIN_HANDLED;  }  else  {   format(menu, 191, "Ready For M4 Practice?^n1. Practice^2. Die" );   show_menu(0 , keys, menu, -1, "m4_menu")   return PLUGIN_CONTINUE;  }  return PLUGIN_HANDLED; } public m4_show(id, key ) {  if(key == 0) // yes  {   strip_guns(id);   fm_give_item(id  , "weapon_m4a1");   cs_set_user_bpammo(id , CSW_M4A1 , 200);  }  else  {   user_kill(id);  }  return PLUGIN_CONTINUE; } public galil_menu(id) {  if(get_cvar_num("amx_practice")==0)  {   return PLUGIN_HANDLED;  }  else  {   format(menu, 191, "Ready For Galil Practice?^n1. Practice^2. Die" );   show_menu(0 , keys, menu, -1, "galil_menu")   return PLUGIN_CONTINUE;  }  return PLUGIN_CONTINUE; }   public galil_show(id, key) {  if(key == 0) // yes  {   strip_guns(id);   fm_give_item(id , "weapon_galil");   cs_set_user_bpammo(id , CSW_GALIL , 200);  }  else  {   user_kill(id);  }  return PLUGIN_CONTINUE; } public aug_menu(id) {  if(get_cvar_num("amx_practice")==0)  {   return PLUGIN_HANDLED;  }  else  {   format(menu, 191, "Ready For Aug Practice?^n1. Practice^2. Die" );   show_menu(0 , keys, menu, -1, "aug_menu") ;   return PLUGIN_CONTINUE;  }  return PLUGIN_HANDLED; } public aug_show(id , key) {  if(key == 0)  // yes  {   strip_guns(id);   fm_give_item(id  , "weapon_aug");   cs_set_user_bpammo(id , CSW_AUG, 200);  }  else  {   user_kill(id);  }  return PLUGIN_HANDLED; } public strip_guns(id) {  fm_strip_user_gun(id, CSW_GLOCK18);  fm_strip_user_gun(id, CSW_M4A1);  fm_strip_user_gun(id, CSW_AK47);  fm_strip_user_gun(id, CSW_SCOUT);  fm_strip_user_gun(id, CSW_XM1014);  fm_strip_user_gun(id, CSW_MAC10);  fm_strip_user_gun(id, CSW_AUG);  fm_strip_user_gun(id, CSW_ELITE);  fm_strip_user_gun(id, CSW_FIVESEVEN);  fm_strip_user_gun(id, CSW_UMP45);  fm_strip_user_gun(id, CSW_SG550);  fm_strip_user_gun(id, CSW_GALIL);  fm_strip_user_gun(id, CSW_FAMAS);  fm_strip_user_gun(id, CSW_USP);  fm_strip_user_gun(id, CSW_AWP);  fm_strip_user_gun(id, CSW_MP5NAVY);  fm_strip_user_gun(id, CSW_M249);  fm_strip_user_gun(id, CSW_M3);  fm_strip_user_gun(id, CSW_TMP);  fm_strip_user_gun(id, CSW_G3SG1);  fm_strip_user_gun(id, CSW_DEAGLE);  fm_strip_user_gun(id, CSW_SG552);  fm_strip_user_gun(id, CSW_P90);  fm_strip_user_gun(id, CSW_P228);  server_cmd("humans_join_team" , "any");  server_cmd("mp_autoteambalance" , "1");  server_cmd("mp_limitteams" , "1");  server_cmd("mp_c4tmer" , "45");  server_cmd("mp_freezetime" , "6");  server_cmd("mp_friendlyfire" , "1");  server_cmd("mp_tkpunish" , "1");  server_cmd("sv_alltalk" , "0");  server_cmd("sv_gravity" , "800");  server_cmd("amx_awppv" , "0");  server_cmd("DF_hook_on" , "0"); }
so how do i use get_user_menu properly to detect when the players menu has gone away ? im getting error for argument mismatch on it.
Nostrodamous is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:51.


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