SA-MP Forums Archive
Dialog.. define problem - 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: Dialog.. define problem (/showthread.php?tid=368421)



Dialog.. define problem - NewbieScripter - 13.08.2012

Errors/Warning:

Код:
error 018: initialization data exceeds declared size
error 018: initialization data exceeds declared size
error 048: array dimensions do not match
error 048: array dimensions do not match
error 048: array dimensions do not match
error 048: array dimensions do not match
error 048: array dimensions do not match
error 048: array dimensions do not match
Code:

pawn Код:
new
    dRegister[420][8] =
    {
        { "Welcome!\n\n" },
        { "Rules\n\n" },
        { "1. ... blah blah blah\n" },
        { "2. blah blah blah blah blah blah blah blah blah blah\n" },
        { "3. blah blah blah blah blah blah blah blah..................\n" },
        { "4. rules here.... blah blah blah................... blah blah\n" },
        { "5. rules here.... blah blah blah blah blah blah blah blah blah blah blah blah\n\n" },
        { "Register your account!\n" }
    },

    dLogin[128][2] =
    {
        { "your account is registred\n" },
        { "please login into your account" }
    };
Usage example..

pawn Код:
ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "Register", dRegister, "OK", "");



Re: Dialog.. define problem - doreto - 13.08.2012

Why you dont use strcat its much bether https://sampwiki.blast.hk/wiki/Strcat


Re: Dialog.. define problem - NewbieScripter - 13.08.2012

Quote:
Originally Posted by doreto
Посмотреть сообщение
Why you dont use strcat its much bether https://sampwiki.blast.hk/wiki/Strcat
thanks..


Re: Dialog.. define problem - NewbieScripter - 13.08.2012

but I use that method (my method..written on the topic) to change it in a hurry .. is not there a solution?


Re: Dialog.. define problem - Vince - 13.08.2012

This is wrong.
pawn Код:
dRegister[420][8]
Should be other way round ([8][420]). Alternatively, you can just leave the dimensions empty. The compiler can calculate the size itself.


Re: Dialog.. define problem - NewbieScripter - 13.08.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
This is wrong.
pawn Код:
dRegister[420][8]
Should be other way round ([8][420]). Alternatively, you can just leave the dimensions empty. The compiler can calculate the size itself.
pawn Код:
new
    dRegister[8][80] =
    {
        "Welcome!\n\n",
        "Rules\n\n",
        "1. ... blah blah blah\n",
        "2. blah blah blah blah blah blah blah blah blah blah\n",
        "3. blah blah blah blah blah blah blah blah..................\n",
        "4. rules here.... blah blah blah................... blah blah\n",
        "5. rules here.... blah blah blah blah blah blah blah blah blah blah blah blah\n\n",
        "Register your account!\n" }
    },

    dLogin[2][34] =
    {
        "your account is registred\n",
        "please login into your account" }
    };
   
    // Usage example
   
    /* Line errors */ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", dRegister[8][80], "OK", "");
   
    // Errors
   
    // error 032: array index out of bounds (variable "dRegister")
    // error 032: array index out of bounds (variable "dRegister")
    // ... same for dLogin



Re: Dialog.. define problem - NewbieScripter - 13.08.2012

uhm ?