SA-MP Forums Archive
Help Me With Dialog - 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: Help Me With Dialog (/showthread.php?tid=409823)



Help Me With Dialog - BodyBoardVEVO - 23.01.2013

Guys, please i am new, so help

pawn Код:
#include a_samp

public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp (cmdtext, "/test", true) == 0)
    {
    new iString[400];
    strcat(iString, "- test");
    strcat(iString, "- {4B4347}test\n");
    strcat(iString, "- {4BFF47}test\n");
    strcat(iString, "- {FF0303}test\n");
    strcat(iString, "- {FFFFFF}test\n");
    strcat(iString, "- {0003FF}test\n");
    strcat(iString, "- {DD8000}test\n");
    strcat(iString, "- {DD00D2}test\n");
    strcat(iString, "- {00ECB7}test\n");
    strcat(iString, "- {FF06FF}test\n");
    strcat(iString, "- {00ECFF}test\n");
    strcat(iString, "- {007000}test\n");
    ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Ok", iString, "Close", "");
    return 1;
    }


pawn Код:
C:\Program Files\Files2\SA-MP Servers\TEST [TESTING SERVER]\filterscripts\11.pwn(19) : error 035: argument type mismatch (argument 3)
C:\Program Files\Files2\SA-MP Servers\Cops And Robbers [TESTING SERVER]\filterscripts\11.pwn(22) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: Help Me With Dialog - denNorske - 23.01.2013

pawn Код:
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
Remember to set the correct parameters.


the number i set as "5" is the Dialog ID - It tells the server what dialogbox you are using.

So when you are on "OnDialogResponse" you can set the dialog id to 5 and select what to happen when you click the button and add things.

Read and learn here!

https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog


Re: Help Me With Dialog - BodyBoardVEVO - 23.01.2013

pawn Код:
C:\Program Files\Files2\SA-MP Servers\TEST[TESTING SERVER]\filterscripts\11.pwn(22) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

pawn Код:
#include a_samp

public OnPlayerCommandText(playerid, cmdtext[])
    if(strcmp (cmdtext, "/test", true) == 0)
    {
    new iString[400];
    strcat(iString, "- test");
    strcat(iString, "- {4B4347}test\n");
    strcat(iString, "- {4BFF47}test\n");
    strcat(iString, "- {FF0303}test\n");
    strcat(iString, "- {FFFFFF}test\n");
    strcat(iString, "- {0003FF}test\n");
    strcat(iString, "- {DD8000}test\n");
    strcat(iString, "- {DD00D2}test\n");
    strcat(iString, "- {00ECB7}test\n");
    strcat(iString, "- {FF06FF}test\n");
    strcat(iString, "- {00ECFF}test\n");
    strcat(iString, "- {007000}test\n");
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
    return 1;
    }



Re: Help Me With Dialog - park4bmx - 23.01.2013

You need to return 1/0 outside of all brackeds (basicly above the closing bracked of the callback) under the callback of the warning.


Re: Help Me With Dialog - BodyBoardVEVO - 23.01.2013

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
You need to return 1/0 outside of all brackeds (basicly above the closing bracked of the callback) under the callback of the warning.
Nothing or i just dont understand


Re: Help Me With Dialog - antonio112 - 23.01.2013

Quote:
Originally Posted by BodyBoardVEVO
Посмотреть сообщение
Nothing or i just dont understand
pawn Код:
#include a_samp

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp (cmdtext, "/test", true) == 0)
        {
            new iString[400];
            strcat(iString, "- test");
            strcat(iString, "- {4B4347}test\n");
            strcat(iString, "- {4BFF47}test\n");
            strcat(iString, "- {FF0303}test\n");
            strcat(iString, "- {FFFFFF}test\n");
            strcat(iString, "- {0003FF}test\n");
            strcat(iString, "- {DD8000}test\n");
            strcat(iString, "- {DD00D2}test\n");
            strcat(iString, "- {00ECB7}test\n");
            strcat(iString, "- {FF06FF}test\n");
            strcat(iString, "- {00ECFF}test\n");
            strcat(iString, "- {007000}test\n");
            ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ok", iString, "Close", "");
        }
    return 1;
}