19.06.2015, 11:05
I dont really know what i need to fix here, im also new to scripting, can anyone help?
Errors what im getting:
Code:
- Thanks.
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
Код:
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; }