Raised This Month: $ Target: $400
 0% 

making players\multipli menus?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ModoZaur
Junior Member
Join Date: Nov 2006
Old 11-06-2006 , 02:55   Re: making players\multipli menus?
Reply With Quote #5

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <amxconst>
#include <cstrike>
#include <fun>
#define PLUGIN "Super FUN plugin Menus"
#define VERSION "1.0"
#define AUTHOR "AlMod"
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSettings[33]
new g_menuSelect[33][64]
new g_menuSelectNum[33]
#define MAX_CLCMDS 24
new g_coloredMenus
new g_cstrike = 0
public plugin_init() 
{
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_dictionary("common.txt")
 
 //Console comands
 register_concmd("amx_godmenu", "cmdGodMenu", ADMIN_LEVEL_A, "- displays godmenu")
 register_menucmd(register_menuid("God Menu"), 1023, "actionGodMenu")
  
 g_coloredMenus = colored_menus()
 
}
/* Gods Menu */
public actionGodMenu(id, key)
{
 switch (key)
 {
  case 8: displayGodMenu(id, ++g_menuPosition[id])
  case 9: displayGodMenu(id, --g_menuPosition[id])
  default:
  {
   new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
   new name[32]
   
   get_user_name(player,name,31)
   
   server_cmd("amx_god %s",name)
   server_exec()
   displayGodMenu(id, g_menuPosition[id])
  }
 }
 return PLUGIN_HANDLED
}
public displayGodMenu(id,pos)
{
 if (pos < 0)
  return // if position less 0 returns
  
 get_players(g_menuPlayers[id], g_menuPlayersNum[id]) // Get players
 new menuBody[512]
 new b = 0
 new i, igod
 new name[32], god[5]
 new start = pos * 8
 if (start >= g_menuPlayersNum[id])
  start = pos = g_menuPosition[id] = 0 
 new len = format(menuBody, 511, g_coloredMenus ? "\yGod Menu\R%d/%d^n\w^n" : "God Menu %d/%d^n^n", id, pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
 
 new end = start + 8
 new keys = MENU_KEY_0//|MENU_KEY_8
 if (end > g_menuPlayersNum[id])
  end = g_menuPlayersNum[id]
  
 for (new a = start; a < end; ++a)
 {
  i = g_menuPlayers[id][a]
  get_user_name(i, name, 31)
  
  if(is_user_alive(i))
  {
   igod = get_user_godmode(i)
   
   if (igod == 1)
   {
    god="ON"
   }
   else if (igod == 0)
   {
    god="OFF"
   } 
  }
  else
  {
   god="DEAD"
  }
  
  if (!is_user_alive(i))
  {
   ++b
   
   if (g_coloredMenus)
    len += format(menuBody[len], 511-len, "\d%d. %s\R%s^n\w", b, name, god)
   else
    len += format(menuBody[len], 511-len, "#. %s   %s^n", name, god)
  }
  else
  {
  keys |= (1<<b)
  len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s   %s^n", b+1, name, god)
  b++
  }
  /*if ((igod == (g_menuOption[id] ? 0 : 1)) || access(i, ADMIN_IMMUNITY))
  {
  / ++b
   
   if (g_coloredMenus)
    len += format(menuBody[len], 511-len, "\d%d. %s\R%s^n\w", b, name, god)
   else
    len += format(menuBody[len], 511-len, "#. %s   %s^n", name, god)
  } else {
   keys |= (1<<b)
   len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s\y\R%s^n\w" : "%d. %s   %s^n", ++b, name, god)
  }*/
 }
 //len += format(menuBody[len], 511-len, "^n8. %L^n", id, "TRANSF_TO", g_menuOption[id] ? "TERRORIST" : "CT")
 if (end != g_menuPlayersNum[id])
 {
  format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
  keys |= MENU_KEY_9
 }
 else
  format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")
 show_menu(id, keys, menuBody, -1, "God Menu")
 
}
public cmdGodMenu(id, level, cid)
{
 if (!cmd_access(id, level, cid, 1))
  return PLUGIN_HANDLED
 g_menuOption[id] = 0
 displayGodMenu(id, g_menuPosition[id] = 0)
 return PLUGIN_HANDLED
}
here is my god menu for super plugin

I'll don't get the main idea of this, but catch some moments & remake it for myself
ModoZaur 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 06:53.


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