SA-MP Forums Archive
Multi Dimensional arrays - 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: Multi Dimensional arrays (/showthread.php?tid=627669)



Multi Dimensional arrays - iLearner - 30.01.2017

Hey,

I was planning to make a small system with arrays, my main objective is to make array with 2 things inside it, 1 with question, another one with answer, i've tried:

PHP код:
new CleverBot[MAX_MESSAGES][2] =
{
{
"question""answer"},
{
"question""answer"}
}; 
With this way it gives me:
Quote:

error 018: initialization data exceeds declared size

I've tried changing the "2" to a bigger number and it was working fine... but i want it to be 2 things only...
When i've tried to make it via enumator:

PHP код:
enum Data
{
    
Question[228],
    
Answer[228]
};
new 
CleverBot[MAX_MESSAGES][2] =
{
{
"question""answer"},
{
"question""answer"}
}; 
It gives me tag mism warning when i want to strfind (if(strfind(CleverBot[i][0], text, true) != -1)).



What am i messing up?


Re: Multi Dimensional arrays - iLearner - 30.01.2017

Sorry, ended up fixing it myself (20 views no help o.o).


Re: Multi Dimensional arrays - Eoussama - 30.01.2017

EDIT: sry, didn't refresh the page


Re: Multi Dimensional arrays - ISmokezU - 30.01.2017

21.

Post the fix.