Dialog,Help me
#1

Good Morning , I have a problem with dialogue , everything I did as a wiki , and not working ..

So I did the dialogue that when he chooses the direction of the school that he throws a message to congratulate blah blah blah , but when I click OK , do not throw me a message already put me on admin duty , why ?? a dialogue in filterscript ..

Код:
enum
{
    DIALOG_SREDNJA,
    DIALOG_FAX,
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])

if(strcmp(cmdtext, "/flesson", true, 6) == 0)
	{
		ShowPlayerDialog(playerid, DIALOG_FAX, DIALOG_STYLE_LIST, "select direction","Electric\nComputer\nMedical","OK","End");
		return 1;
	}
	if(strcmp(cmdtext, "/slesson", true, 6) == 0)
	{
		ShowPlayerDialog(playerid, DIALOG_SREDNJA, DIALOG_STYLE_LIST, "select direction","Electric\nComputer\nGymnasium\nMedical","OK","End");
		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_FAX)
    {
        if(response) 
        {
            SendClientMessage(playerid, 0x33AA33AA, "You have chosen the right direction , teaching begins!");
        }
        else 
        {
            Kick(playerid);
        }
        return 1; 
    }
    if(dialogid == DIALOG_SREDNJA)
    {
        if(response)
        {
            SendClientMessage(playerid, 0x33AA33AA, "You have chosen the right direction , teaching begins!");
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
	return 0;
}
Reply
#2

try

PHP код:
#define DIALOG_FAX #define DIALOG_SREDNJA 
Reply
#3

You didn't make the cases inside OnDialogResponse, Since you're making the dialog style "DIALOG_STYLE_LIST"
Reply
#4

But I try and put this , the wiki to test , and again we come to the dialogue pasword ...


Код:
#define DIALOG_WEAPONS 3
 
// In some command
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Desert Eagle\nAK-47\nCombat Shotgun", "Select", "Close");
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            switch(listitem)
            {
                case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Give them a desert eagle
                case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Give them an AK-47
                case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Give them a Combat Shotgun
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }
 
    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
Reply
#5

Make sure the dialog id isn't the same as password dialog id
Reply
#6

"Make sure the dialog id isn't the same as password dialog id" - Oma37_

"#define DIALOG_FAX #define DIALOG_SREDNJA" - Recardo

What a retarded reply from both of you
-----
PHP код:
enum
{
    
DIALOG_SREDNJA,
    
DIALOG_FAX // you added a comma here

follow the Savana's (your) reply, but don't use the "#define bla" for the dialogs, you will end up being f*cked if you use filterscripts in your server and they use the same define names or the same dialog id number, so use the code that i have posted above (enumerating the dialog ids).

EDIT: use switch for dialog ids and listitems in the dialogs.
Reply
#7

Quote:

What a retarded reply from both of you

Still better than your dumb replies
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)