Help Me With Dialog
#1

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

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

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;
    }
Reply
#4

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

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

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


Forum Jump:


Users browsing this thread: 3 Guest(s)