Splitting an array?
#1

I have an array such as

Example[X][Y][Z][ID]

I need to split that into parts so I can easily make expressions. Does anyone know how? I was recently thinking of this....

pawn Код:
new result[128][5];

split(Example[X][Y][Z][ID], result, ']');

if(result[3] == playerid) print("I R WON PRISE!");


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;
}
I just got a feeling that wont work though. Please help me! Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)