SA-MP Forums Archive
HELP on Extract parameters from string - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP on Extract parameters from string (/showthread.php?tid=121892)



HELP on Extract parameters from string - deather - 19.01.2010

I want to know what is !ExtractParametersFromString?
Please help me


Re: HELP on Extract parameters from string - kmzr - 19.01.2010

I'm not sure what it is, but here's the code incase you don't have it:
pawn Код:
forward ExtractParametersFromString(const string[], number, out[]);

public ExtractParametersFromString(const string[], number, out[])
{//by EKup
new length = strlen(string);
new indexStart = 0;
new indexEnd = 0;
new numParInStr = 0;
out[0]=EOS;
while ((numParInStr < number) && (indexEnd < length))
{
indexStart = indexEnd;
while ((indexEnd < length) && (string[indexEnd] != ' '))
{
indexEnd++;
}
numParInStr++;
if((numParInStr < number) && (indexEnd < length) && (string[indexEnd] == ' ')) indexEnd++;
}
if(numParInStr!=number) return 0;
new offset = indexStart;
for(new i=indexStart; i<indexEnd; i++)
{
out[i - offset] = string[i];
}
out[indexEnd-offset] = EOS;
return 1;
}
//------------------------------------------------------------------------------