splits - 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: splits (
/showthread.php?tid=272313)
splits -
EdeniaGaming - 27.07.2011
Код:
forward splits(const strsrc[], strdest[][], delimiter);
LoadMOTDs()
{
new arrCoords[4][128];
new strFromFile2[512];
new File: file = fopen("motd.ini", io_read);
if (file)
{
fread(file, strFromFile2);
splits(strFromFile2, arrCoords, '|');
Says splits isnt implemented ? giving me that error whys that I have it forwarded
Re: splits -
Calgon - 27.07.2011
You need to create your splits function code, you can't just use the 'forward' function and expect the function to exist.
Judging by a ****** search, your code should be as follows:
pawn Код:
forward splits(const strsrc[], strdest[][], delimiter);
public splits(const strsrc[],strdest[][],delimiter)
{
new aNum, len, i, li;
while(i <= strlen(strsrc))
{
if(strsrc[i] == delimiter || i == strlen(strsrc))
{
len = strmid(strdest[aNum],strsrc,li,i,128);
strdest[aNum][len] = false;
li = i+1;
aNum++;
}
i++;
}
return 1;
}