SA-MP Forums Archive
strtok.inc problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strtok.inc problems (/showthread.php?tid=610035)



strtok.inc problems - CountryTrooper441 - 19.06.2016

Can anyone find the link for it? I can't find it anywhere.. Unless I'm blind...

Thanks..


Re: strtok.inc problems - TheMallard - 19.06.2016

PHP код:
// This function is deprecated and use of it should be avoided where possible.
// Better alternatives like sscanf are available for you to use.
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
 
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;




Re: strtok.inc problems - CountryTrooper441 - 19.06.2016

Thanks man.