28.02.2010, 17:37
pawn Код:
stock split(const strsrc[], strdest[][], delimiter)
{
new li;
i = 0;
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;
}
pawn Код:
new data[4][10];
split(/*Source*/, data, ' ');
for(new i = 0; i<4; i++)
{
if(strval(data[i]) == /*Value here*/)
{
//One of the numbers is a certain number
}
}