Help - 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: Help (
/showthread.php?tid=578398)
Help -
MrMathiasxP - 19.06.2015
I dont really know what i need to fix here, im also new to scripting, can anyone help?
Errors what im getting:
Код:
C:\Users\MrMathiasxP\Desktop\samp rp\gamemodes\rp.pwn(24863) : error 021: symbol already defined: "strtok"
C:\Users\MrMathiasxP\Desktop\samp rp\gamemodes\rp.pwn(24863) : error 003: declaration of a local variable must appear in a compound block
C:\Users\MrMathiasxP\Desktop\samp rp\gamemodes\rp.pwn(24862) : error 010: invalid function or declaration
C:\Users\MrMathiasxP\Desktop\samp rp\gamemodes\rp.pwn(24862 -- 24864) : fatal error 107: too many error messages on one line
Code:
Код:
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
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;
}
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;
}
- Thanks.
Re: Help -
J0sh... - 19.06.2015
strtok(const string[], &index)
new length = strlen(string);
You didn't do
strtok(const string[], &index)
{ <-- this
new length = strlen(string);
Re: Help -
MrMathiasxP - 19.06.2015
Thanks!
- +Rep from me