Menu Open Problem

В този раздел можете да подадете заявка за преработка на даден плъгин. Имайте предвид, че задължително трябва да преодставите кода на въпросния плъгин.
Заключена
Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 169
Регистриран: 29 ное 2017, 22:49
Контакти:

Menu Open Problem

Мнение от lantimilan » 17 май 2018, 19:39

Hello i have one problem when i try to open menu with command not working i dont know for what ?

Код: Избери всички

#pragma tabsize 0

#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1 

#define TASK_INFORMER 4555     

#define Is_User_Admin ADMIN_BAN /* Akcesi: d */
#define Is_User_Vip ADMIN_LEVEL_H /* Akcesi: t */

#define Is_Bit_User_Admin(%0) (get_user_flags(%0) & Is_User_Admin)
#define Is_Bit_User_Vip(%0) (get_user_flags(%0) & Is_User_Vip)

#define Vk_Group      "fb.com/pjeterbudi33"
#define Site_Server   "www.lspublic.com"
#define MenuOpen      // Ju mund ta mbyllni menu edhe me shpejt duke shtypur shkronjen N

new Informer_Public, Max_Player_Server;

new g_iInformerTime[33], g_iInformerMap[33], g_iInformerMain[33], g_iInformerPlayers[33], g_iInformerAdminVip[33], g_iInformerReklama[33];

public plugin_init()
{
    register_plugin("Informatat", "0.5", "XaXa"); 
	
	register_menucmd(register_menuid("Show_InformerSetting"), (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<9), "Handle_InformerSetting");
#if defined MenuOpen
	register_clcmd("nightvision", "InformerSettings");
#else
	register_clcmd("say /info", "InformerSettings");
#endif
	
	Informer_Public = CreateHudSyncObj(); 
	
	Max_Player_Server = get_maxplayers();
}

public client_putinserver( pId )
{
   set_task(1.0, "Public_Informer", pId+TASK_INFORMER, _, _, "b"); 
   
   g_iInformerTime[ pId ] = true, g_iInformerMap[ pId ] = true, g_iInformerPlayers[ pId ] = true;
   g_iInformerAdminVip[ pId ] = true, g_iInformerReklama[ pId ] = true, g_iInformerMain[ pId ] = true;
}

public InformerSettings( pId ) return Show_InformerSetting( pId );

public Show_InformerSetting( pId )
{
    new szMenu[1024], iKeys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<9), iLen = formatex(szMenu, charsmax(szMenu), "\yRregullimi Informatave^n^n");
	
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[1] \wOra \d[%s\d]^n", g_iInformerTime[ pId ] ? "\yAktive" : "\rNdalur");
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[2] \wMapa \d[%s\d]^n^n", g_iInformerMap[ pId ] ? "\yAktive" : "\rNdalur");
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[3] \wLojtaret \d[%s\d]^n", g_iInformerPlayers[ pId ] ? "\yAktive" : "\rNdalur");
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[4] \wAdmin,VIP \d[%s\d]^n", g_iInformerAdminVip[ pId ] ? "\yAktive" : "\rNdalur");
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[5] \wReklama \d[%s\d]^n^n", g_iInformerReklama[ pId ] ? "\yAktive" : "\rNdalur");
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y[6] \wInformatat \d[%s\d]^n^n", g_iInformerMain[ pId ] ? "\yAktive" : "\rNdalur");
    
	formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y[0] \wMbylle");
    return show_menu(pId, iKeys, szMenu, -1, "Show_InformerSetting");
}

public Handle_InformerSetting(pId, iKey)
{
    switch(iKey)
    {
        case 0: 
		{
		    if(g_iInformerTime[ pId ]) g_iInformerTime[ pId ] = false;
			else if(!g_iInformerTime[ pId ]) g_iInformerTime[ pId ] = true;
		}
		case 1: 
		{
		    if(g_iInformerMap[ pId ]) g_iInformerMap[ pId ] = false;
			else if(!g_iInformerMap[ pId ])g_iInformerMap[ pId ] = true;
		}
		case 2: 
		{
		    if(g_iInformerPlayers[ pId ]) g_iInformerPlayers[ pId ] = false;
			else if(!g_iInformerPlayers[ pId ]) g_iInformerPlayers[ pId ] = true;
		}
		case 3: 
		{
		    if(g_iInformerAdminVip[ pId ]) g_iInformerAdminVip[ pId ] = false;			
			else if(!g_iInformerAdminVip[ pId ]) g_iInformerAdminVip[ pId ] = true;
			
		}
		case 4: 
		{
		    if(g_iInformerReklama[ pId ]) g_iInformerReklama[ pId ] = false;
			else if(!g_iInformerReklama[ pId ]) g_iInformerReklama[ pId ] = true;
		}
		case 5: 
		{
		    if(g_iInformerMain[ pId ]) g_iInformerMain[ pId ] = false;
			else if(!g_iInformerMain[ pId ]) g_iInformerMain[ pId ] = true;
		}
		case 9: return PLUGIN_HANDLED;
    }
    return Show_InformerSetting( pId );
}

public Public_Informer( pId )
{
	pId -= TASK_INFORMER;
	
	static Informer_Main[1024], Informer_Time[1024], Informer_Map[1024], Informer_MaxPlayer[1024], Informer_Reklama[1024], Informer_AdminVip[1024];
	new sTime[32], Map[34];
	
	get_time("%H:%M:%S", sTime, charsmax(sTime));
	get_mapname(Map, charsmax(Map));
	
	if(g_iInformerMain[ pId ]) formatex(Informer_Main, charsmax(Informer_Main), "%s^n%s^n%s^n%s^n%s", Informer_Time, Informer_Map, Informer_MaxPlayer, Informer_AdminVip, Informer_Reklama);
	else formatex(Informer_Main, charsmax(Informer_Main), "");
	if(g_iInformerMap[ pId ]) formatex(Informer_Map, charsmax(Informer_Map), "Mapa: %s", Map);
    else formatex(Informer_Map, charsmax(Informer_Map), "");
	if(g_iInformerTime[ pId ]) formatex(Informer_Time, charsmax(Informer_Time), "Ora: %s", sTime);
	else formatex(Informer_Time, charsmax(Informer_Time), "");
	if(g_iInformerPlayers[ pId ]) formatex(Informer_MaxPlayer, charsmax(Informer_MaxPlayer), "Lojtaret: %d/%d", Get_Player_All(), Max_Player_Server);
	else formatex(Informer_MaxPlayer, charsmax(Informer_MaxPlayer), "");
	if(g_iInformerAdminVip[ pId ]) formatex(Informer_AdminVip, charsmax(Informer_AdminVip), "Adminat: %d^nV.I.P: %d", Get_Admin(), Get_VIP());
    else formatex(Informer_AdminVip, charsmax(Informer_AdminVip), "");
	if(g_iInformerReklama[ pId ]) formatex(Informer_Reklama, charsmax(Informer_Reklama), "Kontakti: %s^nWeb: %s", Vk_Group, Site_Server);
	else formatex(Informer_Reklama, charsmax(Informer_Reklama), "", Vk_Group, Site_Server);
	
	set_hudmessage(100, 100, 100, 0.01, 0.23, 0, 0.0, 0.8, 0.2, 0.2, -1);
	ShowSyncHudMsg(pId, Informer_Public, "%s", Informer_Main); 
}

stock Get_Admin()
{
	new ADMIN;
	ADMIN = 0;
	for (new pId = 1; pId <= Max_Player_Server; pId++)
	{
		if (!is_user_connected( pId ) || !Is_Bit_User_Admin( pId ))
			continue;
			
		ADMIN++;
	}
	return ADMIN;
}

stock Get_VIP()
{
	new VIP;
	VIP = 0;
	for (new pId = 1; pId <= Max_Player_Server; pId++)
	{
		if (!is_user_connected( pId ) || !Is_Bit_User_Vip( pId ))
			continue;
			
		VIP++;
	}
	return VIP;
}

/* Сток, для количество игроков */
stock Get_Player_All()
{
	new PlCount;
	PlCount = 0;
	for (new pId = 1; pId <= Max_Player_Server; pId++)
	{
		if (!is_user_connected( pId ))
			continue;
			
		PlCount++;
	}
	return PlCount;
}

/* END */

Потребителски аватар

RideeR ;] 1337
AMXX Скриптър
AMXX Скриптър
Мнения: 170
Регистриран: 05 окт 2016, 21:30

Menu Open Problem

Мнение от RideeR ;] 1337 » 18 май 2018, 13:07

Better use the new menus instead of the old ones.Check here

Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 169
Регистриран: 29 ное 2017, 22:49
Контакти:

Menu Open Problem

Мнение от lantimilan » 18 май 2018, 15:05

but i dont know how to set in plugin can you help me ?

Потребителски аватар

TryAgain FakeTaxi
AMXX Скриптър
AMXX Скриптър
Мнения: 97
Регистриран: 25 яну 2017, 16:59

Menu Open Problem

Мнение от TryAgain FakeTaxi » 18 май 2018, 16:37

Fixed menu and some of the features.
Прикачени файлове
plugin_info.sma
(6.14 KиБ) Свален 6 пъти
plugin_info.sma
(6.14 KиБ) Свален 6 пъти

Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 169
Регистриран: 29 ное 2017, 22:49
Контакти:

Menu Open Problem

Мнение от lantimilan » 19 май 2018, 11:00

Not working again not open menu with /info

Потребителски аватар

RideeR ;] 1337
AMXX Скриптър
AMXX Скриптър
Мнения: 170
Регистриран: 05 окт 2016, 21:30

Menu Open Problem

Мнение от RideeR ;] 1337 » 19 май 2018, 11:18

Do you put the plugin correctly?

Потребителски аватар

TryAgain FakeTaxi
AMXX Скриптър
AMXX Скриптър
Мнения: 97
Регистриран: 25 яну 2017, 16:59

Menu Open Problem

Мнение от TryAgain FakeTaxi » 19 май 2018, 15:01

lantimilan написа:
19 май 2018, 11:00
Not working again not open menu with /info
Just make this change on line 19.

Код: Избери всички

#define MENU_KEY_N // Custum for N
==>

Код: Избери всички

//#define MENU_KEY_N // Custum for N
and will be done :)

Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 169
Регистриран: 29 ное 2017, 22:49
Контакти:

Menu Open Problem

Мнение от lantimilan » 19 май 2018, 17:57

thanks for help its okey now , admin close thread :D

Заключена

Върни се в “Преработка на плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 1 гост