how to send cilent message through dialog box
#1

how to send cilent message through dialog box plz help
Reply
#2

pawn Код:
ShowPlayerDialog(playerid,dialogid, DIALOG_STYLE_MSGBOX,"Message","This is a Message","Ok","");
Reply
#3

If it is DIALOG_STYLE_MSGBOX You can normally type the Message in it.
Reply
#4

didn't understand
hmm something like this maybe?

pawn Код:
public OnPlayerConnect(playerid)
{
   ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_LIST,"Test","Blah 1\nblah 2","select","cancel");
   return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
     case 0: // dialog id
     {
        if(!response) // when he press 'cancel'
        {
           SendClientMessage(playerid,-1,"Canceled.");
           return 1;
        }
        if(listitem == 0) // when he press 'blah 1'
        {
            SendClientMessage(playerid, -1,"You pressed blah 1 !");
        }
      else if(listitem == 1) // when he press 'blah 2'
        {
            SendClientMessage(playerid, -1,"You pressed blah 2 !");
        }
    }
   return 1;
}
Reply
#5

Example:
pawn Код:
new id;
#define DIALOG_TALK 69

CMD:talk(playerid,params[])
{
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-2,"USAGE: /talk [playerid]");
{
ShowPlayerDialog(playerid, DIALOG_TALK, DIALOG_INPUT, "Talk here","Enter your text below!","Send","Cancel");
}
return 1;
}

// Dialog response:
if(dialogid == DIALOG_TALK)
{
if(response)
{
SendClientMessage(id,-2,inputtext);
}
}
Try that, it's untested but should work. You need SSCANF + ZCMD
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)