How I get this split stock working?
#1

Hello, this is the current split stock I use:

pawn Код:
stock split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i] == delimiter || i == strlen(strsrc))
        {
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}
And it works sometimes
This time it doesnt work:

pawn Код:
new Coords[16][3];
split(inputtext,Coords, ',');

// Inputtext = : 244.411987,305.032989,999.148437
// Coords[0] = : 244305999.148437
// Coords[1] = : 305999.148437
// Coords[2] = : 999.148437
Somebody knows what the problem is here?

Thanks...
Reply
#2

Uhm I totaly forgot that, thanks!
Reply
#3

pawn Код:
new Coords[3][16];
You have the numbers in wrong order, first should be 3 and then 16.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)