Dialog Help Please
#1

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
Reply
#2

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;
Reply
#3

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.
Reply
#4

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

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.
Reply
#6

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");
Reply
#7

I mean in the OnDialogResponce
Reply
#8

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

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

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

    }
    case DIALGOG_2:{
   
    }
}
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)