Help Menu
It gives many errors in it and not know how to make it go
[sursa=]#include <amxmodx> #include <amxmodx> #include <amxmisc> #define PLUGIN "Special Who" #define VERSION "1.0" #define AUTHOR "Mariusz.-" #define CharsMax(%1) sizeof %1 - 1 #define time_shower 1.0 #pragma semicolon 1 #define MAX_GROUPS 7 new const g_groupNames[ MAX_GROUPS ][ ] = { "*Founder", "*Owner", "*God", "*Moderator", "*Slot VZG" } new const g_groupFlags[ MAX_GROUPS ][ ] = { "abcdefghijklmnopqrstu", "abcdefghijklmnopqrs", "bcdefghijmnopqr", "bcdefijmnop", "b", } new const g_groupFlagsVIP[ MAX_GROUPS ][ ] = { "abcdefghijklmnopqrstuvx", "abcdefghijklmnopqrsvx", "bcdefghijmnopqrvx", "bcdefijmnopvx", "bvx", } static const TITLE_MENU[ ] = "\rStaff\y HNS.VZG.RO"; static const MENU_NAME[ ] = "\r| \wNume Admin \r| \wGrad \r|\w VIP \r|"; static const NO_ADMINS_MENU_NAME[ ] = "\y Nu sunt admini online"; static const MENU_EXIT_NAME[ ] = "\yIesire"; public plugin_init( ) { register_plugin( PLUGIN, VERSION, AUTHOR ); register_clcmd( "say /who", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say /admins", "cmdWho", ADMIN_USER, "" ); register_concmd( "say /admin", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say_team /who", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say_team /admins", "cmdWho", ADMIN_USER, "" ); register_concmd( "say_team /admin", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say /preturi", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say /server", "cmdWho", ADMIN_USER, "" ); register_concmd( "say /founder", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say_team /preturi", "cmdWho", ADMIN_USER, "" ); register_clcmd( "say_team /server", "cmdWho", ADMIN_USER, "" ); register_concmd( "say_team /founder", "cmdWho", ADMIN_USER, "" ); } public cmdWho( id ) { ShowMenu( id, 0 ); return 1; } public cmdPreturi( id ) { ShowMenu( id, 0 ); return 1; } public cmdServer( id ) { ShowMenu(id, 0 ); return 1; public Whomenu(id) { new wmenu = menu_create("\r[\yi\r]\w Meniu HNS.VZG.RO" , "MenuHand"); menu_additem(wmenu ,"Admini VZG", "1" , 0); menu_additem(wmenu ,"Preturi Admine", "2" , 0); menu_additem(wmenu ,"Beneficii VIP", "3" , 0); menu_additem(wmenu ,"Detalii Server / Founder", "4" , 0); menu_setprop(wmenu , MPROP_EXIT , MEXIT_ALL); menu_display(id , wmenu , 0); } public ShowMenu(id, page) { new MenuName[ 64 ], MenuExitKey[ 32 ]; formatex( MenuName, sizeof ( MenuName ) -1, "%s", MENU_NAME ); formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", MENU_EXIT_NAME ); new menu = menu_create(MenuName, "MenuHandler"); if( AdminsOnline( ) ) { for( new i = 0; i < MAX_GROUPS; i++ ) { AddAdminsToMenu( id, menu, i ); } } else { menu_additem( menu, NO_ADMINS_MENU_NAME, "1", 0 ); } menu_setprop(menu, MPROP_EXITNAME, MenuExitKey ); menu_display(id, menu, page); } public MenuHandler(id, menu, item) { if(item == MENU_EXIT) { menu_destroy( menu ); return 1; } new data[6], iName[64]; new iaccess, callback; menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback); new key = str_to_num(data); switch(key) { case 1,2,3,4,5,6: { menu_destroy( menu ); return 1; } } return 0; } public MenuHand(id, wmenu, item) { if (item == MENU_EXIT) { menu_destroy(wmenu) return PLUGIN_HANDLED } new data[6], iName[64] new access, callback menu_item_getinfo(wmenu, item, access, data, 5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1,2,4: { case 3: { show_motd(id,"/addons/amxmodx/data/multi-plugin/vipinfo.html") } } menu_destroy(wmenu) return PLUGIN_HANDLED; } public AddAdminsToMenu( const id, const iMenu, const iGroup ) { new szMenuMessage[ 64 ], szMenuKey[ 32 ], iMenuKey = 1; new iPlayers[ 32 ]; new iPlayersNum, iPlayer; get_players( iPlayers, iPlayersNum, "c" ); for( new i = 0 ; i < iPlayersNum ; i++ ) { iPlayer = iPlayers[ i ]; if( UserHasGroupAcces( iPlayer, iGroup ) ) { formatex( szMenuMessage, sizeof (szMenuMessage ) -1, "\w%s \y| \w%s \y| %s\y | %s", get_name( iPlayer ), g_groupNames[ iGroup ], IsUserVip( iPlayer )? "\rx" : "\dx", iPlayers[ i ] == id ? "\r *" : "" ); formatex( szMenuKey, sizeof ( szMenuKey ) -1, "%i", iMenuKey ); menu_additem( iMenu, szMenuMessage, szMenuKey, 0 ); iMenuKey++; } } } stock bool:AdminsOnline( ) { new bool:AdminsFound = false; new iPlayers[ 32 ]; new iPlayersNum; get_players( iPlayers, iPlayersNum, "c" ); for( new i = 0 ; i < iPlayersNum ; i++ ) { if( UserHasAnyAcces( iPlayers[ i ] ) >= 0 ) { AdminsFound = true; break; } } return AdminsFound; } stock bool:IsUserVip( id ) { if( get_user_flags( id ) & read_flags( "vx" ) ) return true; return false; } stock bool:UserHasGroupAcces( id, const iGroup ) { static iFlags; iFlags = get_user_flags( id ); if( iFlags == read_flags( g_groupFlags[ iGroup ] ) || iFlags == read_flags( g_groupFlagsVIP[ iGroup ] ) ) return true; return false; } stock UserHasAnyAcces( id ) { new iFlags = get_user_flags( id ); new iValueToReturn = -2; for( new i = 0; i < MAX_GROUPS; i++ ) { if( iFlags == read_flags( g_groupFlags[ i ] ) || iFlags == read_flags( g_groupFlagsVIP[ i ] ) ) { iValueToReturn = i; break; } } return iValueToReturn; } stock get_name( id ) { new name[ 32 ]; get_user_name( id, name, sizeof ( name ) -1 ); return name; } [/sursa] Please Help, Thanks ! |
Re: Help Menu
You need to simply read the errors. Most of them will tell you what you did wrong (that is why they are there). Also, if you don't want to use semicolons to end lines, you need to remove the requirement ("#pragma semicolon 1"). Another thing that I notice is that your last array item cannot have a comma after it.
Also, please update your topic title because it currently has nothing to do with your issue (this is a forum rule that your topic title must describe your question or issue). |
Re: Help Menu
You have too undefined symbols.Define ShowMenu,AdminsOnline,item...
|
| All times are GMT -4. The time now is 09:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.