25.08.2016, 21:40
strtok nгo й include
use no final do gamemode ou filterscript
ou
use no final do gamemode ou filterscript
Код:
strtok(const string[], &index) // Faster strtok Code by Jeffry
{
new result[20], length = strlen(string), i = index;
while ((i < length) && (string[i] == ' ')) i++;
strmid(result,string,i,((index = strfind(string, " ", false, i)) == -1) ? (index = length) : (index) , 20);
index++;
return result;
}
Код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index, result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

