SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/08/2012, 10:52 AM   #1
NewbieScripter
Big Clucker
 
Join Date: Jul 2012
Posts: 108
Reputation: 0
Default Dialog.. define problem

Errors/Warning:

Code:
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 Code:
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 Code:
ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "Register", dRegister, "OK", "");
NewbieScripter is offline   Reply With Quote
Old 13/08/2012, 10:55 AM   #2
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Location: pawno && htdocs
Posts: 1,659
Reputation: 113
Default Re: Dialog.. define problem

Why you dont use strcat its much bether http://wiki.sa-mp.com/wiki/Strcat
doreto is offline   Reply With Quote
Old 13/08/2012, 10:58 AM   #3
NewbieScripter
Big Clucker
 
Join Date: Jul 2012
Posts: 108
Reputation: 0
Default Re: Dialog.. define problem

Quote:
Originally Posted by doreto View Post
Why you dont use strcat its much bether http://wiki.sa-mp.com/wiki/Strcat

thanks..
NewbieScripter is offline   Reply With Quote
Old 13/08/2012, 11:09 AM   #4
NewbieScripter
Big Clucker
 
Join Date: Jul 2012
Posts: 108
Reputation: 0
Default Re: Dialog.. define problem

but I use that method (my method..written on the topic) to change it in a hurry .. is not there a solution?
NewbieScripter is offline   Reply With Quote
Old 13/08/2012, 11:50 AM   #5
Vince
Godfather
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 6,599
Reputation: 1719
Default Re: Dialog.. define problem

This is wrong.
pawn Code:
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.
__________________

Vince is offline   Reply With Quote
Old 13/08/2012, 12:46 PM   #6
NewbieScripter
Big Clucker
 
Join Date: Jul 2012
Posts: 108
Reputation: 0
Default Re: Dialog.. define problem

Quote:
Originally Posted by Vince View Post
This is wrong.
pawn Code:
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 Code:
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
NewbieScripter is offline   Reply With Quote
Old 13/08/2012, 01:07 PM   #7
NewbieScripter
Big Clucker
 
Join Date: Jul 2012
Posts: 108
Reputation: 0
Default Re: Dialog.. define problem

uhm ?
NewbieScripter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with define deimantas1 Scripting Help 2 25/03/2012 11:18 AM
#define problem. ikkentim Scripting Help 1 21/03/2012 04:33 PM
Define problem No Fear Scripting Help 22 11/12/2011 04:39 PM
Define problem gamer931215 Scripting Help 10 03/09/2011 04:59 PM
Problem with define KuHS Help Archive 2 08/07/2010 10:13 AM


All times are GMT. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.