←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Mały problem z menu

Zablokowany

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 05.08.2011

W tym menu Wyjscie jest pod klawiszem 8, jak zrobic aby bylo pod 0 ?

public MainMenu(id)
{
new msg0[128]
format(msg0,127,"\r[\wDeathRun ExpMod\r]\y Menu");
new MainMenu = menu_create(msg0, "MainMenu_wybierz")
new msg1[128]
format(msg1,127,"\wDodaj punkty")
menu_additem(MainMenu , msg1, "1", 0)
new msg2[128]
format(msg2,127,"\wZrob reset")
menu_additem(MainMenu , msg2, "2", 0)
new msg3[128]
format(msg3,127,"\wGracze")
menu_additem(MainMenu , msg3, "3", 0)
new msg4[128]
format(msg4,127,"\wSklep")
menu_additem(MainMenu , msg4, "4", 0)
new msg5[128]
format(msg5,127,"\wDodatki")
menu_additem(MainMenu , msg5, "5", 0)
new msg6[128]
format(msg6,127,"\wCo Daje VIP?")
menu_additem(MainMenu , msg6, "6", 0)
new msg7[128]
format(msg7,127,"\wKup VIPa/Expa^n")
menu_additem(MainMenu , msg7, "7", 0)
new msg10[128]
format(msg10,127,"\wWyjscie")
menu_additem(MainMenu , msg10, "0", 0)

menu_setprop(MainMenu,MPROP_EXIT,MEXIT_NEVER);

menu_setprop(MainMenu,MPROP_PERPAGE,0);

menu_display(id, MainMenu, 0)
}
Odpowiedz

  • +
  • -
Hiroshima - zdjęcie Hiroshima 05.08.2011

Automatyczna wiadomość


Ten temat został przeniesiony z forum:
AMX Mod X -> Problemy z pluginami
do
Scripting -> Pytania
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

To co z tym jest nie tak ?
Użytkownik LucKy_skiLL edytował ten post 06.08.2011 16:49
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

Zrób z format menu przykład kodu : Działa w 100%
static menu[2048];

    new len = format( menu, sizeof menu - 1, "\rNazwa Menu" );
    
    len += format( menu[len], sizeof menu - len, "\r01. Cos");
    len += format( menu[len], sizeof menu - len, "\r02. Cos2 ")
 
    len += format( menu[len], sizeof menu - len, "\r00. \wWyjscie" ); // jest pod 0 
    
    show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
        
    return PLUGIN_HANDLED;
}
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

Coś takiego ?

public SerwerMenu(id)
{

static menu[2048];

new len = format( menu, sizeof menu - 1, "\r[\wDeathRun ExpMod\r]\y Menu Serwera" );

len += format( menu[len], sizeof menu - len, "\r1. \wExpMod");
len += format( menu[len], sizeof menu - len, "\r2. \wCzapki")

len += format( menu[len], sizeof menu - len, "\r0. \wWyjscie" ); // jest pod 0

show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}
Odpowiedz

  • +
  • -
se7en - zdjęcie se7en 06.08.2011

albo po prostu nie dodawaj przycisku "wyjscie", tylko ustaw w menu wyjscie ;] przycisk 0.exit zostanie zmieniony automatycznie. Wtedy tylko zmienisz nazwe i git ! :]
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

Dałem tak

public SerwerMenu(id)
{
new msg0[128]
format(msg0,127,"\r[\wDeathRun ExpMod\r]\y Menu Serwera");
new SerwerMenu = menu_create(msg0, "SerwerMenu_wybierz")
new msg1[128]
format(msg1,127,"\wExpMod")
menu_additem(SerwerMenu , msg1, "1", 0)
new msg2[128]
format(msg2,127,"\wCzapki")
menu_additem(SerwerMenu , msg2, "2", 0)
new msg3[128]
format(msg3,127,"\wForum^n")
menu_additem(SerwerMenu , msg3, "3", 0)

menu_setprop(SerwerMenu,MPROP_EXIT,MEXIT_NEVER);

menu_setprop(SerwerMenu,MPROP_PERPAGE,0);

menu_display(id, SerwerMenu, 0)
}




I teraz nie ma napisu wyjscie
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

Coś takiego ?

public SerwerMenu(id)
{

static menu[2048];

new len = format( menu, sizeof menu - 1, "\r[\wDeathRun ExpMod\r]\y Menu Serwera" );

len += format( menu[len], sizeof menu - len, "\r1. \wExpMod");
len += format( menu[len], sizeof menu - len, "\r2. \wCzapki")

len += format( menu[len], sizeof menu - len, "\r0. \wWyjscie" ); // jest pod 0

show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}

Tak zadziała ;]
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

A jak zrobic odwołanie do komend ?
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

public SerwerMenuAction( plr, key )

 {

 switch( key )

 {

 case 0:

 {



 }

 case 1:

 {



 }

 case 9: show_menu( plr, 0, "" );

 }

 }
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

Mam tak

public SerwerMenu(id)
{

static menu[2048];

new len = format( menu, sizeof menu - 1, "\r[\wDeathRun ExpMod\r]\y Menu Serwera^n^n" );

len += format( menu[len], sizeof menu - len, "\r1. \wExpMod^n");
len += format( menu[len], sizeof menu - len, "\r2. \wCzapki^n");
len += format( menu[len], sizeof menu - len, "\r3. \wForum^n^n");
len += format( menu[len], sizeof menu - len, "\r0. \wWyjscie");

show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}

public SerwerMenuAction( id, plr, key )
{
switch( key ){
case 0 : {
MainMenu(id);
}
case 1 : {
client_cmd(id,"say /czapki");
}
case 2 : {
show_motd (id,"motd.txt","Your-Game.PL");
}
case 9: show_menu( plr, 0, "" );
}
}



I po wybraniu czegos z menu nic sie nie dzieje
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

Mam tak

public SerwerMenu(id)
{

static menu[2048];

new len = format( menu, sizeof menu - 1, "\r[\wDeathRun ExpMod\r]\y Menu Serwera^n^n" );

len += format( menu[len], sizeof menu - len, "\r1. \wExpMod^n");
len += format( menu[len], sizeof menu - len, "\r2. \wCzapki^n");
len += format( menu[len], sizeof menu - len, "\r3. \wForum^n^n");
len += format( menu[len], sizeof menu - len, "\r0. \wWyjscie");

show_menu( plr, ( 1<<0 | 1<<1 | | 1<<2 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}

public SerwerMenuAction( id, plr, key )
{
switch( key ){
case 0 : {
MainMenu(id);
}
case 1 : {
client_cmd(id,"say /czapki");
}
case 2 : {
show_motd (id,"motd.txt","Your-Game.PL");
}
case 9: show_menu( plr, 0, "" );
}
}



I po wybraniu czegos z menu nic sie nie dzieje

public SerwerMenu(id)
{

static menu[2048];

new len = format( menu, sizeof menu - 1, "\r[\wDeathRun ExpMod\r]\y Menu Serwera^n^n" );

len += format( menu[len], sizeof menu - len, "\r1. \wExpMod^n");
len += format( menu[len], sizeof menu - len, "\r2. \wCzapki^n");
len += format( menu[len], sizeof menu - len, "\r3. \wForum^n^n");
len += format( menu[len], sizeof menu - len, "\r0. \wWyjscie");

show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}

public SerwerMenuAction( id, key )
{
switch( key ){
case 0 : {
MainMenu(id);
}
case 1 : {
client_cmd(id,"say /czapki");
}
case 2 : {
show_motd (id,"motd.txt","Your-Game.PL");
}
case 9: show_menu( id, 0, "" );
}
}

Użytkownik speedkill123 edytował ten post 06.08.2011 20:28
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

Nadal nie działa, po wybraniu 1 lub 2 menu znika
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

Masz tu wycinek kod z pluginu invis edytuj na swoje potrzeby
public menuInvisDisplay( plr )
{
    static menu[2048];

    new len = format( menu, sizeof menu - 1, "\rInvisibility - SchlumPF^n^n" );
    
    len += format( menu[len], sizeof menu - len, "\r01. Players: %s^n", g_bPlayerInvisible[plr] ? "invisible" : "visible" );
    len += format( menu[len], sizeof menu - len, "\r02. Water: %s^n^n", g_bWaterFound ? ( g_bWaterInvisible[plr] ? "invisible" : "visible" ) : "there is no water" );
 
    len += format( menu[len], sizeof menu - len, "\r00. \wExit" );
    
    show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
        
    return PLUGIN_HANDLED;
}

public menuInvisAction( plr, key )
{
    switch( key )
    {
        case 0:
        {
            g_bPlayerInvisible[plr] = !g_bPlayerInvisible[plr];
            menuInvisDisplay( plr );
        }
        case 1:
        {
            g_bWaterInvisible[plr] = !g_bWaterInvisible[plr];
            menuInvisDisplay( plr );
        }
        case 9: show_menu( plr, 0, "" );
    }
}
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

Dalej to samo :/
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 06.08.2011

Tworzenie menu - AMXX.pl: Support AMX Mod X
Tam masz opisane jak zrobić
#define MENU_KEY_0		(1<<9)
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 06.08.2011

To już nie rozumiem, najpierw sugerujesz robic tym formatem, a teraz całe menu mam robic od nowa? Kurde mi tylko o to 0 chodzi ^^
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 07.08.2011

Coś z tym formatem nie działało więc spróbuj tym albo napisz mi dokładnie co tam ma być itp to ci zrobie ;]
Odpowiedz

  • +
  • -
LucKy_skiLL - zdjęcie LucKy_skiLL 07.08.2011

Zmieniłem to menu, ale mam kilka problemów

- Dodając punkt do skilla z drugiej listy automatycznie przełącza się na pierwsza
- Naciskając "Dalej" na drugiej liście expmoda, nic się nie dzieje

Pomożesz?


http://amxx.pl/wklej...6723799844/txt/
Odpowiedz
Zablokowany