Como se diseсa un menu (cuadro)? -
jeanpierrevera - 29.03.2011
Bueno me refiero a por ejemplo solo quiero que me den las bases de como se lo crea por ejemplo que cuando pongan
/armas les salga un cuadro en el cual habran opciones armas pesadas, armas de mano y al entrar al sub menu les salgan las armas por categorias y q algunas sean compradas y otras gratis
Re: Como se diseсa un menu (cuadro)? -
MaRcOsWeB - 29.03.2011
Ya existen tutoriales asн, existen Filterscript, pero la gente sigue creando threads, total los que terminamos buscando somos nosotros.
Re: Como se diseсa un menu (cuadro)? -
jeanpierrevera - 29.03.2011
pues uno busca ayuda y le dicen eso -.- si dices q exiten dime donde y conociendo bas a decir busca en el buscador -.-
Re: Como se diseсa un menu (cuadro)? -
murdoxix - 29.03.2011
Solo me tardo 5 segundos encontrarlos -.-
Menu de autos y armas
EDIT:
OBVIO que te dirб que uses el buscador
Respuesta: Como se diseсa un menu (cuadro)? -
Lunnatiicz - 29.03.2011
Quote:
Originally Posted by MaRcOsWeB
Ya existen tutoriales asн, existen Filterscript, pero la gente sigue creando threads, total los que terminamos buscando somos nosotros.
|
El esta pidiendo AYUDA, No que se lo hagamos, rectifica.
Quote:
Originally Posted by jeanpierrevera
pues uno busca ayuda y le dicen eso -.- si dices q exiten dime donde y conociendo bas a decir busca en el buscador -.-
|
Exacto, creo que todos se han ido por la ignores. Bien acб te dejo un ejemplo (Wiki)
pawn Код:
if(!strcmp(cmdtext, "/drinks", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second item listed
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2: // The third item listed
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
}
}
return 1;
https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Si tienes dudas, avisa
Re: Como se diseсa un menu (cuadro)? -
jeanpierrevera - 29.03.2011
muchas gracias como dije solo necesitaaba las bases de ahi lo leo y edito y entiendo y hago los mios xd gracias
Re: Respuesta: Como se diseсa un menu (cuadro)? -
jeanpierrevera - 29.03.2011
Quote:
Originally Posted by Lunnatiicz
El esta pidiendo AYUDA, No que se lo hagamos, rectifica.
Exacto, creo que todos se han ido por la ignores. Bien acб te dejo un ejemplo (Wiki)
pawn Код:
if(!strcmp(cmdtext, "/drinks", true)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel"); return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response)// They pressed the first button. { switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs. { case 1:// Our dialog! { switch(listitem)// Checking which listitem was selected { case 0:// The first item listed { if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -1); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); } case 1: // The second item listed { if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -2); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); } case 2: // The third item listed { if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -3); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); } } } } } return 1;
https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Si tienes dudas, avisa
|
pues me suleta full errores me da paja ponerlos pero comprueba si tengo q incluir algo ademas noto q ese return hasta esta mal colocado no se ve q tienes mal xD
EDITO: era de poner en otro calback o algo asi pero me suelta este warning
pawn Код:
C:\Server\gamemodes\migamemode.pwn(711) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
y yo lo puse asi:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// Checking if they pressed the first button, if so continue:
{
switch(dialogid)//if your using only one dialog this isn't needed but you never know.
{
case 1:// Our dialog
{
switch(listitem)// Checking which listitem was chosen
{
case 0: // The first item in the list
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second item in the list
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2: // The third item in the list
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
case 2:// The new dialog
{
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,1,1,1,1,10);// This will let you "relax" for 10 seconds.
}
// Here we add new things...
case 3:
{
if(strlen(inputtext) > 0)
{
SendPlayerMessageToAll(playerid, inputtext);
}
else
{
SendClientMessage(playerid,0xFFFFFFAA,"Your input was too short.");
}
}
// Until here.
}
}
return 1;
}
Re: Como se diseсa un menu (cuadro)? -
MaRcOsWeB - 29.03.2011
Es que con simplemente usar el buscador, pones menu armas y salen muchos resultados, hay que aprender a usar las caracteristicas del foro en vez de llenar la base de datos del foro con los mismos posts. Total nadie te prohibe postear en un tutorial si no entiendes algo.
Re: Como se diseсa un menu (cuadro)? -
TiNcH010 - 29.03.2011
Quote:
Originally Posted by MaRcOsWeB
Es que con simplemente usar el buscador, pones menu armas y salen muchos resultados, hay que aprender a usar las caracteristicas del foro en vez de llenar la base de datos del foro con los mismos posts. Total nadie te prohibe postear en un tutorial si no entiendes algo.
|
їPor que te la agarras con una persona que no sabe y recien aprende? Como me imagino que vos en algun momento lo habras pasado o como todos -.-
En vez de decir boludeses del espacio en la base de datos en el foro primero pensa y despues razona antes de postear estas cosas ¬¬
Lo estamos ayudando no criticando.
Respuesta: Re: Respuesta: Como se diseсa un menu (cuadro)? -
Lunnatiicz - 29.03.2011
Quote:
Originally Posted by jeanpierrevera
pues me suleta full errores me da paja ponerlos pero comprueba si tengo q incluir algo ademas noto q ese return hasta esta mal colocado no se ve q tienes mal xD
EDITO: era de poner en otro calback o algo asi pero me suelta este warning
pawn Код:
C:\Server\gamemodes\migamemode.pwn(711) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
y yo lo puse asi:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response)// Checking if they pressed the first button, if so continue: { switch(dialogid)//if your using only one dialog this isn't needed but you never know. { case 1:// Our dialog { switch(listitem)// Checking which listitem was chosen { case 0: // The first item in the list { if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -1); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); } case 1: // The second item in the list { if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -2); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); } case 2: // The third item in the list { if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -3); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); } } }
case 2:// The new dialog { ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,1,1,1,1,10);// This will let you "relax" for 10 seconds. } // Here we add new things... case 3: { if(strlen(inputtext) > 0) { SendPlayerMessageToAll(playerid, inputtext); } else { SendClientMessage(playerid,0xFFFFFFAA,"Your input was too short."); } } // Until here. } } return 1; }
|
Pon a mero arriba de tu gm lo siguiente, debajo de tus includes
Y deseparecerб ese warn