[Ajuda] Alguem me ajuda na DIALOG
#1

Galera na PPC_Trucking o /cmds q agora estб /comandos eles aparece em uma box preta que й a DIALOG_STYLE_LIST, porйm quero mudar para a DIALOG_STYLE_MSGBOX, sу que o cуdigo nгo aparece nada escrito DIALOG_STYLE_LIST para que eu possa modificar a DIALOG, oque eu faзo ? aqui estб a parte que digo.

Код:
Dialog_PlayerCommands(playerid, response, listitem)
{
	// Just close the dialog if the player clicked "Cancel"
	if(!response)
	{
		// Reset the FirstCommand (so the list won't start at an unexpected location in the list, but back at the start of the list)
		APlayerData[playerid][DialogFirstItem] = 0;
		return 1; // Exit the function
	}

	// Process the selected listitem
	switch (listitem)
	{
		case 11: // Player chooses "Proximo ..."
		{
		    // Add 5 to the FirstCommand, so the list will start further down the array (will show the next 5 commands)
		    APlayerData[playerid][DialogFirstItem] = APlayerData[playerid][DialogFirstItem] + 5;
		    // Create a new list of commands and show the dialog
		    CommandList_Create(playerid);
		}
	}

	return 1;
}
Reply
#2

De uma olhada na PPC_Common,procure por

pawn Код:
CommandList_Create(playerid)
Se n resolver acho que devera criar o dialog novamente.
Reply
#3

Quote:
Originally Posted by lHesoyaml
Посмотреть сообщение
De uma olhada na PPC_Common,procure por

pawn Код:
CommandList_Create(playerid)
Se n resolver acho que devera criar o dialog novamente.
Sim eu mudei http://prntscr.com/2m8u7u , porйm agora quando entra no jogo fica como eu queria mas quando clica em Prox.. nгo avanзa: http://prntscr.com/2m8w79 oque eu faзo ?

Код:
CommandList_Create(playerid)
{
	// Setup local variables
	new Counter, CommandList[1000], DialogTitle[128];

	// Only add 4 commands to the list, starting from the FirstItem
	for (new i = APlayerData[playerid][DialogFirstItem]; i < sizeof(ACommands); i++)
	{
		// Increase a counter (which holds the number of commands that have been added to the list
		Counter++;

		// Check if the maximum hasn't been reached yet
		if (Counter <= 5)
		{
		    // Check if this command is valid for this player
			if (APlayerData[playerid][PlayerLevel] >= ACommands[i][CommandLevel])
			{
				// Check if the command is used for admins or not
				if (ACommands[i][CommandLevel] == 0)
				{
				    // Add the commandname and description to the list
					format(CommandList, 500, "%s%s{00FF00}%s", CommandList, "\n", ACommands[i][CommandStructure]); // Add the name of the next command to the list on the next line
					format(CommandList, 500, "%s%s\t\t{FFFF00}%s", CommandList, "\n", ACommands[i][CommandDescription]); // Add the description of the next command to the list on the next line
				}
				else
				{
				    // Add the commandname and description to the list
					format(CommandList, 500, "%s%sLvl %i: {00FF00}%s", CommandList, "\n", ACommands[i][CommandLevel], ACommands[i][CommandStructure]); // Add the name of the next command to the list on the next line
					format(CommandList, 500, "%s%s\t\t{FFFF00}%s", CommandList, "\n", ACommands[i][CommandDescription]); // Add the description of the next command to the list on the next line
				}
			}
			else
				break;
		}
		else // 5 commands have been added to the list (now Counter = 6)
		{
		    // Add an empty line and "Next..." to the list to let the player know there are more commands
			format(CommandList, 500, "%s%s%s", CommandList, "\n \n", TXT_DialogEntryNext);
			// Also stop the For-loop
			break;
		}
	}

	// Construct the title for the dialog (to include a page number)
	format(DialogTitle, 128, TXT_DialogCommandTitle, (APlayerData[playerid][DialogFirstItem] / 5) + 1);
	// Show the commands in a dialog
	ShowPlayerDialog(playerid, DialogPlayerCommands, DIALOG_STYLE_MSGBOX, DialogTitle, CommandList, TXT_DialogButtonSelect, TXT_DialogButtonCancel);

	return 1;
}
Reply
#4

Tenta assim com as definiзхes do seu GM.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == CommandsCase)
    {
        if(!response) return Mensagem(playerid, BRANCO, "Vocк Cancelou a Dialog de Comandos!");
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    new CommandBox[700];
                    format(gString, sizeof(gString), "comandos do seu servidor\n\n"); strcat(CommandBox, gString);
                    ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Comandos", CommandBox, "Ok", "Cancelar");
                    }
                case 1:
                {
                    new CommandBox[700];
                    format(gString, sizeof(gString), "comandos do seu servidor\n\n"); strcat(CommandBox, gString);
                    ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Comandos", CommandBox, "Ok", "Cancelar");
                    }
Reply
#5

Quote:
Originally Posted by lHesoyaml
Посмотреть сообщение
Tenta assim com as definiзхes do seu GM.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == CommandsCase)
    {
        if(!response) return Mensagem(playerid, BRANCO, "Vocк Cancelou a Dialog de Comandos!");
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    new CommandBox[700];
                    format(gString, sizeof(gString), "comandos do seu servidor\n\n"); strcat(CommandBox, gString);
                    ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Comandos", CommandBox, "Ok", "Cancelar");
                    }
                case 1:
                {
                    new CommandBox[700];
                    format(gString, sizeof(gString), "comandos do seu servidor\n\n"); strcat(CommandBox, gString);
                    ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Comandos", CommandBox, "Ok", "Cancelar");
                    }
й pra por isso na GM ? ou no PPC_Commons q й de onde eu te enviei o primeiro texto ?
Reply
#6

No Gm na public OnDialogResponse
Reply
#7

Quote:
Originally Posted by lHesoyaml
Посмотреть сообщение
No Gm na public OnDialogResponse
Nгo tem uma maneira melhor de resolver na PPC_Commom modificando esse code aqui nгo ?

Код:
CommandList_Create(playerid)
{
	// Setup local variables
	new Counter, CommandList[1000], DialogTitle[128];

	// Only add 4 commands to the list, starting from the FirstItem
	for (new i = APlayerData[playerid][DialogFirstItem]; i < sizeof(ACommands); i++)
	{
		// Increase a counter (which holds the number of commands that have been added to the list
		Counter++;

		// Check if the maximum hasn't been reached yet
		if (Counter <= 5)
		{
		    // Check if this command is valid for this player
			if (APlayerData[playerid][PlayerLevel] >= ACommands[i][CommandLevel])
			{
				// Check if the command is used for admins or not
				if (ACommands[i][CommandLevel] == 0)
				{
				    // Add the commandname and description to the list
					format(CommandList, 500, "%s%s{00FF00}%s", CommandList, "\n", ACommands[i][CommandStructure]); // Add the name of the next command to the list on the next line
					format(CommandList, 500, "%s%s\t\t{FFFF00}%s", CommandList, "\n", ACommands[i][CommandDescription]); // Add the description of the next command to the list on the next line
				}
				else
				{
				    // Add the commandname and description to the list
					format(CommandList, 500, "%s%sLvl %i: {00FF00}%s", CommandList, "\n", ACommands[i][CommandLevel], ACommands[i][CommandStructure]); // Add the name of the next command to the list on the next line
					format(CommandList, 500, "%s%s\t\t{FFFF00}%s", CommandList, "\n", ACommands[i][CommandDescription]); // Add the description of the next command to the list on the next line
				}
			}
			else
				break;
		}
		else // 5 commands have been added to the list (now Counter = 6)
		{
		    // Add an empty line and "Next..." to the list to let the player know there are more commands
			format(CommandList, 500, "%s%s%s", CommandList, "\n \n", TXT_DialogEntryNext);
			// Also stop the For-loop
			break;
		}
	}

	// Construct the title for the dialog (to include a page number)
	format(DialogTitle, 128, TXT_DialogCommandTitle, (APlayerData[playerid][DialogFirstItem] / 5) + 1);
	// Show the commands in a dialog
	ShowPlayerDialog(playerid, DialogPlayerCommands, DIALOG_STYLE_MSGBOX, DialogTitle, CommandList, TXT_DialogButtonSelect, TXT_DialogButtonCancel);

	return 1;
}
Reply
#8

Infeslimente nгo sei.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)