SA-MP Forums Archive
Dialog Help Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog Help Please (/showthread.php?tid=193646)



Dialog Help Please - Gavin - 26.11.2010

Hey, I want to create a dialog that will be a input style dialog, I need help with the OnDialogResponce stuff.

I have done this already for the command.
pawn Код:
COMMAND:news(playerid, params[])
{
    if(isnewsreporter[playerid])
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "News", "Type the news in the box.", "Submit", "Cancel");
    }
    else SendClientMessage(playerid, 0xff0000ff, "ERROR: You are not a News Reporter");
    return 1;
}
If you could make the OnDialogResponce for me I would be glad, What i want it to do is the message that they type in the box to be sent to everyone on the server in the chat without there name infront, just the news.

- Gavin


Re: Dialog Help Please - Cameltoe - 26.11.2010

pawn Код:
if(!response) return 0; // checks if the player did respond to the dialog returns 0 if not.
new string[128]; format(string, sizeof(string), "News reporter %s reported that: %s",GetPlayerNameEx(playerid), inputtext);
SendClientMessageToAll(COLOR, string);
return 1;



Re: Dialog Help Please - Gavin - 26.11.2010

Do i have to put something, so it knows what dialog thats for like the dialog id?

I also got 1 error
pawn Код:
C:\Documents and Settings\Gavin Donaldson\Desktop\sa-mp server 0.3b\gamemodes\GRolePlay.pwn(307) : error 017: undefined symbol "GetPlayerNameEx"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: Dialog Help Please - Cameltoe - 26.11.2010

pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pName[24];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}



Re: Dialog Help Please - Gavin - 27.11.2010

Do I have to write something to define what dialog it is like the id of the dialog? Because I want to make more Dialogs.


Re: Dialog Help Please - Cameltoe - 27.11.2010

Quote:
Originally Posted by Gavin
Посмотреть сообщение
Do I have to write something to define what dialog it is like the id of the dialog? Because I want to make more Dialogs.
You don't have to but you should.

Код:
#define DIALOG_1
#define DIALOG_2

ShowPlayerDialog(playerid, DIALOG_1, DIALOG_STYLE_INPUT, "1", "1", "1", "1");
ShowPlayerDialog(playerid, DIALOG_2, DIALOG_STYLE_INPUT, "2", "2", "2", "2");



Re: Dialog Help Please - Gavin - 27.11.2010

I mean in the OnDialogResponce


Re: Dialog Help Please - Cameltoe - 27.11.2010

Quote:
Originally Posted by Gavin
Посмотреть сообщение
I mean in the OnDialogResponce
Код:
case DIALOG_1:
{
}
case DIALOG_2:
{
}



Re: Dialog Help Please - Mujib - 27.11.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Код:
case DIALOG_1:
{
}
case DIALOG_2:
{
}
Correction:

pawn Код:
switch(dialogid){
    case DIALOG_1:{

    }
    case DIALGOG_2:{
   
    }
}



Re: Dialog Help Please - Zh3r0 - 27.11.2010

Quote:
Originally Posted by Mujib
Посмотреть сообщение
Correction:

pawn Код:
switch(dialogid){
    case DIALOG_1:{

    }
    case DIALGOG_2:{
   
    }
}
That's the same thing If it's under or in front it's same thing, you can add the { even after 10.000 lines, it will still work!