Detaljan opis problema: Ovako funkcija strtok nesto za***ava. Deklarisao sam tmp i izbacuje error 017, kad stavim new za te errore, pojavi se error 035.
Dio skripte: [pawn]CMD:call( playerid, params[] )
{
if(UlogovanProvera[playerid] == 1)
{
//new tmp[128], strtok, cmdtext, idx, text;
tmp = strtok(text, idx);
if(!strlen(tmp))
{
ShowPlayerDialog(playerid, DIALOG_CALL, DIALOG_STYLE_LIST, "Test","1\n2\n3\n4","Odaberi","Zatvori");
return 1;
}[/pawn]
Znaci izbacuje error 017 za: tmp, text, Kada uklonim komentar onaj gore za new tmp, izbaci erorr 001, 029 za "tmp = strtok(text, idx);"
Moguce da je i moj neki propust i da mi je stao mozak.
Evo ovao sto sam dodao za funkciju strtok, standard uzeo sa wiki
[pawn]strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index,
result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}[/pawn]
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Cemu strtok kada imas sscanf?