Getting all characters one by one
#4

There is a stock of "split" in wiki.

pawn Code:
// Author unknown. It was probably someone smart like [[User:DracoBlue|DracoBlue]] or [[User:Y_Less|Y_Less]].
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;
}
check this out for usage:
https://sampwiki.blast.hk/wiki/Code_Snippets
Reply


Messages In This Thread
Getting all characters one by one - by Don_Cage - 25.07.2014, 16:31
Re: Getting all characters one by one - by Abagail - 25.07.2014, 16:33
Re: Getting all characters one by one - by Don_Cage - 25.07.2014, 16:42
Re: Getting all characters one by one - by Champ - 25.07.2014, 17:22

Forum Jump:


Users browsing this thread: 3 Guest(s)