#1

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.
Reply
#2

strtok(const string[], &index)
new length = strlen(string);
You didn't do
strtok(const string[], &index)
{ <-- this
new length = strlen(string);
Reply
#3

Thanks!

- +Rep from me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)