| 
 
 
	
		
		
			| Создание Меню |  |  |  | 
| VamPir1217 | Дата: Воскресенье, 21.12.2014, 17:47:15 | Сообщение # 61 |  |   
|  |  | Сообщений: 24 Репутация: 0 [ +/- ]
 |  | Подскажите , как заменить "Назад" на другое название. Например "->". Кажется у wS'a где то видел. |  |  |  |  |  | 
| BarD | Дата: Воскресенье, 21.12.2014, 17:55:48 | Сообщение # 62 |  |   
|  |  | Сообщений: 943 Репутация: 137 [ +/- ]
 |  | Делаешь итем со своим названием и по его нажатию откатываешь на страницу назад. |  |  |  |  |  | 
| «SeReGa»☆ | Дата: Понедельник, 22.12.2014, 18:25:17 | Сообщение # 63 |  |   
|  |  | Сообщений: 395 Репутация: 37 [ +/- ]
 |  | Дайте пожалуйста пример)) 
 
 Сообщение отредактировал «SeReGa»☆ - Вторник, 10.02.2015, 00:25:35 |  |  |  |  |  | 
| Stepo4kin | Дата: Среда, 22.07.2015, 00:27:36 | Сообщение # 64 |  |   
|  |  | Сообщений: 1 Репутация: 0 [ +/- ]
 |  | в первом посте панели и меню отображаются В ИГРЕ в небольшом окошке, а у меня в hl2dm меню отображается как ОКНО, да еще и только В ГЛАВНОМ МЕНЮ(как например создать сервер или окно настроек) Подскажите как исправить
 
 | Гости не могут скачивать файлы | 
 |  |  |  |  |  | 
| Scarface_slv | Дата: Среда, 22.07.2015, 22:03:57 | Сообщение # 65 |  |   
|  |  | Сообщений: 737 Репутация: 61 [ +/- ]
 |  | Handle:CreatePanel(Handle:hStyle=INVALID_HANDLE); - создаёт панель и возвращает её Handle. Если вернёт INVALID_HANDLE, значит произошла ошибка.
 
 
 Код  hStyle (стиль меню):
 
 MenuStyle_Default = 0 // The "default" menu style for the mod
 MenuStyle_Valve = 1 // The Valve provided menu style (Used on HL2DM)
 MenuStyle_Radio = 2 // The simpler menu style commonly used on CS:S
 
попробуй что нить из этого
 CreatePanel(MenuStyle_Valve);
 CreatePanel(MenuStyle_Radio);
 |  |  |  |  |  | 
| «SeReGa»☆ | Дата: Пятница, 24.07.2015, 15:41:41 | Сообщение # 66 |  |   
|  |  | Сообщений: 395 Репутация: 37 [ +/- ]
 |  | также на меню.. 
 new Handle:menu = CreateMenuEx(GetMenuStyleHandle(MenuStyle_Radio), MenuHNDL, MenuAction_Select|MenuAction_End|MenuAction_DisplayItem);
 |  |  |  |  |  | 
| «SeReGa»☆ | Дата: Пятница, 24.07.2015, 15:43:42 | Сообщение # 67 |  |   
|  |  | Сообщений: 395 Репутация: 37 [ +/- ]
 |  | а вообще есть крутая штука которая намного упростит создание меню 
 | Гости не могут скачивать файлы | 
 |  |  |  |  |  | 
| sourcegod | Дата: Суббота, 25.07.2015, 09:54:34 | Сообщение # 68 |  |   
|  |  | Сообщений: 69 Репутация: 0 [ +/- ]
 |  | VamPir1217, В меню:
 
 Код  SetPanelCurrentKey(panel, 8);
 DrawPanelItem(panel, "<--");
 В проверку:
 
 Код case 8: название твоего меню(client);Если ты делаешь через switch.
 
 А если по другому то:
 
 Код if(option == 8)   {
 название твоего меню(client);
 }
 
 
 Сообщение отредактировал sourcegod - Суббота, 25.07.2015, 10:00:15 |  |  |  |  |  | 
| Angel_hell | Дата: Вторник, 19.01.2016, 21:46:58 | Сообщение # 69 |  |   
|  |  | Сообщений: 2 Репутация: 0 [ +/- ]
 |  | Выдает ошибку на 128 строчке, не могу понять в чем проблема, помогите плз. Менюшка для Jail
 
 Код #include <sourcemod>#include <sdktools>
 
 #define PLUGIN_VERSION "3.0.1"
 
 new Warden = -1;
 new Handle:g_cVar_mnotes = INVALID_HANDLE;
 new Handle:g_fward_onBecome = INVALID_HANDLE;
 new Handle:g_fward_onRemove = INVALID_HANDLE;
 
 public Plugin:myinfo = {
 name = "Jailbreak Warden",
 author = "ecca",
 description = "Jailbreak Warden script",
 version = PLUGIN_VERSION,
 url = "ffac.eu"
 };
 
 new Handle:cvar_ff;
 new iEnt;
 new String:EntityList[][] = {
 
 "func_door",
 "func_rotating",
 "func_walltoggle",
 "func_breakable",
 "func_door_rotating",
 "func_movelinear",
 "prop_door",
 "prop_door_rotating",
 "func_tracktrain",
 "func_elevator",
 "\0"
 };
 
 public OnPluginStart()
 {
 // Initialize our phrases
 LoadTranslations("simon.phrases");
 
 // Register our public commands
 RegConsoleCmd("sm_simon", BecomeWarden);
 RegConsoleCmd("say !simon", BecomeWarden);
 RegConsoleCmd("sm_simonmenu", Simonmenu);
 RegConsoleCmd("sm_us", ExitWarden);
 RegConsoleCmd("sm_unsimon", ExitWarden);
 
 // Register our admin commands
 RegAdminCmd("sm_rsimon", RemoveWarden, ADMFLAG_GENERIC);
 
 // Hooking the events
 HookEvent("round_start", roundStart); // For the round start
 HookEvent("player_death", playerDeath); // To check when our warden dies :)
 
 // For our warden to look some extra cool
 AddCommandListener(HookPlayerChat, "say");
 
 // May not touch this line
 CreateConVar("sm_warden_version", PLUGIN_VERSION, "The version of the SourceMod plugin JailBreak Warden, by ecca", FCVAR_REPLICATED|FCVAR_SPONLY|FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);
 g_cVar_mnotes = CreateConVar("sm_warden_better_notifications", "0", "0 - disabled, 1 - Will use hint and center text", FCVAR_PLUGIN, true, 0.0, true, 1.0);
 
 g_fward_onBecome = CreateGlobalForward("warden_OnWardenCreated", ET_Ignore, Param_Cell);
 g_fward_onRemove = CreateGlobalForward("warden_OnWardenRemoved", ET_Ignore, Param_Cell);
 cvar_ff = FindConVar("mp_teammates_are_enemies");
 }
 
 public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
 {
 CreateNative("warden_exist", Native_ExistWarden);
 CreateNative("warden_iswarden", Native_IsWarden);
 CreateNative("warden_set", Native_SetWarden);
 CreateNative("warden_remove", Native_RemoveWarden);
 
 RegPluginLibrary("warden");
 
 return APLRes_Success;
 }
 
 public Action:BecomeWarden(client, args)
 {
 if (Warden == -1) // There is no warden , so lets proceed
 {
 if (GetClientTeam(client) == 3) // The requested player is on the Counter-Terrorist side
 {
 if (IsPlayerAlive(client)) // A dead warden would be worthless >_<
 {
 SetTheWarden(client);
 Simonmenu(client, 0);
 SetEntityHealth(client, 255);
 }
 else // Grr he is not alive -.-
 {
 PrintToChat(client, "[Каторга] ~ %t", "warden_playerdead");
 }
 }
 else // Would be wierd if an terrorist would run the prison wouldn't it :p
 {
 PrintToChat(client, "[Каторга] ~ %t", "warden_ctsonly");
 }
 }
 else // The warden already exist so there is no point setting a new one
 {
 PrintToChat(client, "[Каторга] ~ %t", "warden_exist", Warden);
 }
 }
 
 public Action:Simonmenu(client, args)
 {
 new Handle:menu = CreateMenu(DIDMenuHandlerS);
 SetMenuTitle(menu, "Меню саймона");
 
 AddMenuItem(menu, "open", "Открыть клетки");
 AddMenuItem(menu, "fdone", "Дать ФД игроку");
 AddMenuItem(menu, "fdall", "Дать всем ФД");
 
 if(!GetConVarBool(cvar_ff)) AddMenuItem(menu, "ffa1", "Включить бокс");
 else AddMenuItem(menu, "ffa2", "Выключить бокс");
 
 AddMenuItem(menu, "nosimon", "Отдать саймона");
 SetMenuExitButton(menu, true);
 DisplayMenu(menu, client, MENU_TIME_FOREVER);
 }
 
 public DIDMenuHandlerS(Handle:menu, MenuAction:action, client, itemNum)
 {
 if ( action == MenuAction_Select )
 {
 if(Warden() != client) return;
 
 new String:info[32];
 
 GetMenuItem(menu, itemNum, info, sizeof(info));
 
 if ( strcmp(info,"open") == 0 )
 {
 abrir();
 Simonmenu(client,0);
 }
 else if ( strcmp(info,"fdone") == 0 )
 {
 FDone(client);
 }
 
 else if ( strcmp(info,"fdall") == 0 )
 {
 FDTodos();
 PrintToChatAll(" \x04[Каторга] \x05Дать всем ФД");
 Simonmenu(client,0);
 }
 else if ( strcmp(info,"ffa1") == 0 )
 {
 SetCvar("mp_teammates_are_enemies", 1);
 PrintToChatAll(" \x04[Каторга] \x05Включить бокс");
 
 Simonmenu(client,0);
 }
 else if ( strcmp(info,"ffa2") == 0 )
 {
 SetCvar("mp_teammates_are_enemies", 0);
 PrintToChatAll(" \x04[Каторга] \x05Саймон выключил бокс");
 
 Simonmenu(client,0);
 }
 else if ( strcmp(info,"nosimon") == 0 )
 {
 FakeClientCommand(client, "sm_unsimon");
 DOMenu(client,0);
 }
 
 }
 else if (action == MenuAction_End)
 {
 CloseHandle(menu);
 }
 }
 
 public Action:abrir()
 {
 for(new i = 0; i < sizeof(EntityList); i++)
 while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
 AcceptEntityInput(iEnt, "Open");
 return Plugin_Handled;
 }
 
 FDTodos()
 {
 for (new i = 1; i < MaxClients; i++)
 if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
 JB_GiveFD(i);
 }
 
 FDone(client)
 {
 new Handle:menu = CreateMenu(DIDMenuHandlerFD);
 SetMenuTitle(menu, "Кому дать ФД?");
 
 decl String:temp2[8], String:temp[128];
 new cuenta = 0;
 for (new i = 1; i < MaxClients; i++)
 if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T && !JB_GetFD(i))
 {
 Format(temp, 128, "%N", i);
 Format(temp2, 8, "%i", i);
 AddMenuItem(menu, temp2, temp);
 
 cuenta++;
 }
 
 SetMenuExitButton(menu, true);
 DisplayMenu(menu, client, MENU_TIME_FOREVER);
 
 if(cuenta == 0)
 {
 PrintToChat(client, " \x04[Каторга] \x05Нет живых зеков");
 DOsimon(client,0);
 }
 }
 
 public DIDMenuHandlerFD(Handle:menu, MenuAction:action, client, itemNum)
 {
 if ( action == MenuAction_Select )
 {
 if(Warden() != client) return;
 
 new String:info[32];
 
 GetMenuItem(menu, itemNum, info, sizeof(info));
 
 new i = StringToInt(info);
 if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
 {
 JB_GiveFD(i);
 PrintToChatAll(" \x04[Каторга] \x05Саймон дал ФД игроку %N", i);
 
 Simonmenu(client,0);
 }
 else
 {
 PrintToChat(client, " \x04[Каторга] \x05Выберите другого игрока");
 FDone(client);
 }
 
 }
 else if (action == MenuAction_End)
 {
 CloseHandle(menu);
 }
 }
 
 public Action:ExitWarden(client, args)
 {
 if(client == Warden) // The client is actually the current warden so lets proceed
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_retire", client);
 if(GetConVarBool(g_cVar_mnotes))
 {
 PrintCenterTextAll("[Каторга] ~ %t", "warden_retire", client);
 PrintHintTextToAll("[Каторга] ~ %t", "warden_retire", client);
 }
 Warden = -1; // Open for a new warden
 SetEntityRenderColor(client, 255, 255, 255, 255); // Lets remove the awesome color
 }
 else // Fake dude!
 {
 PrintToChat(client, "[Каторга] ~ %t", "warden_notwarden");
 }
 }
 
 public Action:roundStart(Handle:event, const String:name[], bool:dontBroadcast)
 {
 Warden = -1; // Lets remove the current warden if he exist
 }
 
 public Action:playerDeath(Handle:event, const String:name[], bool:dontBroadcast)
 {
 new client = GetClientOfUserId(GetEventInt(event, "userid")); // Get the dead clients id
 
 if(client == Warden) // Aww damn , he is the warden
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_dead", client);
 if(GetConVarBool(g_cVar_mnotes))
 {
 PrintCenterTextAll("[Каторга] ~ %t", "warden_dead", client);
 PrintHintTextToAll("[Каторга] ~ %t", "warden_dead", client);
 }
 SetEntityRenderColor(client, 255, 255, 255, 255); // Lets give him the standard color back
 Warden = -1; // Lets open for a new warden
 }
 }
 
 public OnClientDisconnect(client)
 {
 if(client == Warden) // The warden disconnected, action!
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_disconnected");
 if(GetConVarBool(g_cVar_mnotes))
 {
 PrintCenterTextAll("[Каторга] ~ %t", "warden_disconnected", client);
 PrintHintTextToAll("[Каторга] ~ %t", "warden_disconnected", client);
 }
 Warden = -1; // Lets open for a new warden
 }
 }
 
 public Action:RemoveWarden(client, args)
 {
 if(Warden != -1) // Is there an warden at the moment ?
 {
 RemoveTheWarden(client);
 }
 else
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_noexist");
 }
 
 return Plugin_Handled; // Prevent sourcemod from typing "unknown command" in console
 }
 
 public Action:HookPlayerChat(client, const String:command[], args)
 {
 if(Warden == client && client != 0) // Check so the player typing is warden and also checking so the client isn't console!
 {
 new String:szText[256];
 GetCmdArg(1, szText, sizeof(szText));
 
 if(szText[0] == '/' || szText[0] == '@' || IsChatTrigger()) // Prevent unwanted text to be displayed.
 {
 return Plugin_Handled;
 }
 
 if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3) // Typing warden is alive and his team is Counter-Terrorist
 {
 PrintToChatAll("[Каторга] %N : %s", client, szText);
 return Plugin_Handled;
 }
 }
 
 return Plugin_Continue;
 }
 
 public SetTheWarden(client)
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_new", client);
 
 if(GetConVarBool(g_cVar_mnotes))
 {
 PrintCenterTextAll("[Каторга] ~ %t", "warden_new", client);
 PrintHintTextToAll("[Каторга] ~ %t", "warden_new", client);
 }
 Warden = client;
 SetEntityRenderColor(client, 0, 0, 255, 255);
 SetClientListeningFlags(client, VOICE_NORMAL);
 
 Forward_OnWardenCreation(client);
 }
 
 public RemoveTheWarden(client)
 {
 PrintToChatAll("[Каторга] ~ %t", "warden_removed", client, Warden);
 if(GetConVarBool(g_cVar_mnotes))
 {
 PrintCenterTextAll("[Каторга] ~ %t", "warden_removed", client);
 PrintHintTextToAll("[Каторга] ~ %t", "warden_removed", client);
 }
 SetEntityRenderColor(Warden, 255, 255, 255, 255);
 Warden = -1;
 
 Forward_OnWardenRemoved(client);
 }
 
 public Native_ExistWarden(Handle:plugin, numParams)
 {
 if(Warden != -1)
 return true;
 
 return false;
 }
 
 public Native_IsWarden(Handle:plugin, numParams)
 {
 new client = GetNativeCell(1);
 
 if(!IsClientInGame(client) && !IsClientConnected(client))
 ThrowNativeError(SP_ERROR_INDEX, "Client index %i is invalid", client);
 
 if(client == Warden)
 return true;
 
 return false;
 }
 
 public Native_SetWarden(Handle:plugin, numParams)
 {
 new client = GetNativeCell(1);
 
 if (!IsClientInGame(client) && !IsClientConnected(client))
 ThrowNativeError(SP_ERROR_INDEX, "Client index %i is invalid", client);
 
 if(Warden == -1)
 {
 SetTheWarden(client);
 }
 }
 
 public Native_RemoveWarden(Handle:plugin, numParams)
 {
 new client = GetNativeCell(1);
 
 if (!IsClientInGame(client) && !IsClientConnected(client))
 ThrowNativeError(SP_ERROR_INDEX, "Client index %i is invalid", client);
 
 if(client == Warden)
 {
 RemoveTheWarden(client);
 }
 }
 
 public Forward_OnWardenCreation(client)
 {
 Call_StartForward(g_fward_onBecome);
 Call_PushCell(client);
 Call_Finish();
 }
 
 public Forward_OnWardenRemoved(client)
 {
 Call_StartForward(g_fward_onRemove);
 Call_PushCell(client);
 Call_Finish();
 }
 
 
 Сообщение отредактировал Angel_hell - Вторник, 19.01.2016, 22:55:17 |  |  |  |  |  | 
| BarD | Дата: Четверг, 21.01.2016, 09:16:36 | Сообщение # 70 |  |   
|  |  | Сообщений: 943 Репутация: 137 [ +/- ]
 |  | Цитата Angel_hell (  ) if(Warden() != client) return;У тебя нет функции Warden(). Не знаю, что ты хотел этим сделать, но здесь определенно неверно.
 |  |  |  |  |  | 
| Angel_hell | Дата: Четверг, 21.01.2016, 16:08:21 | Сообщение # 71 |  |   
|  |  | Сообщений: 2 Репутация: 0 [ +/- ]
 |  | Цитата BarD (  ) У тебя нет функции Warden(). Не знаю, что ты хотел этим сделать, но здесь определенно неверно.
 Когда кт нажмет функцию "взять Саймона", ктшнику присваивается переменная Warden, и потом мне нужно провести поверку, если игрок не warden, то
 возврат функции.
 Если я делаю сравнение как переменную, то у меня ломаются квары. Нету мыслей как можно это нормально сделать
 |  |  |  |  |  | 
| Darkeneez | Дата: Четверг, 21.01.2016, 18:51:58 | Сообщение # 72 |  |   
|  |  | Сообщений: 221 Репутация: 18 [ +/- ]
 |  | Цитата Angel_hell (  ) Когда кт нажмет функцию "взять Саймона", ктшнику присваивается переменная Warden, и потом мне нужно провести поверку, если игрок не warden, товозврат функции.
 Если я делаю сравнение как переменную, то у меня ломаются квары. Нету мыслей как можно это нормально сделать
 Каким образом у тебя квары ломаются? Там весь плагин из этой проверки состоит warden != client делай и не выдумывай ничего
 
 Сообщение отредактировал Darkeneez - Четверг, 21.01.2016, 20:55:54 |  |  |  |  |  | 
| Vitaminoz | Дата: Суббота, 06.08.2016, 16:55:06 | Сообщение # 73 |  |   
|  |  | Сообщений: 141 Репутация: 1 [ +/- ]
 |  | Возможно ли как то при установке флага на menu item'e ITEMDRAW_DISABLED сделать так, чтобы оно было кликабельно, но при этом текст в меню был белого цвета ? |  |  |  |  |  | 
| SourceSamil | Дата: Суббота, 06.08.2016, 19:17:27 | Сообщение # 74 |  |   
|  |  | Сообщений: 237 Репутация:  [ +/- ]
 |  | No, Нет, Nein |  |  |  |  |  | 
| Vitaminoz | Дата: Суббота, 06.08.2016, 19:39:01 | Сообщение # 75 |  |   
|  |  | Сообщений: 141 Репутация: 1 [ +/- ]
 |  | А возможно сделать как то по другому это (пример меню радиосообщений в CS) через другие флаги или чего то еще ? |  |  |  |  |  
 |