SA-MP Forums Archive
how to send cilent message through dialog box - 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)
+--- Thread: how to send cilent message through dialog box (/showthread.php?tid=409084)



how to send cilent message through dialog box - mittukuttan - 20.01.2013

how to send cilent message through dialog box plz help


Re: how to send cilent message through dialog box - Dolby - 20.01.2013

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



Re: how to send cilent message through dialog box - SilverKiller - 20.01.2013

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


Re: how to send cilent message through dialog box - V_LOPE - 20.01.2013

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;
}



Re: how to send cilent message through dialog box - Infinity90 - 20.01.2013

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