Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Dragi poslato Februar 14, 2018, 21:16:49 POSLE PODNE

Naslov: Strtok
Poruka od: Dragi poslato Februar 14, 2018, 21:16:49 POSLE PODNE
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):
Naslov: Odg: Strtok
Poruka od: // xunder poslato Februar 14, 2018, 22:06:23 POSLE PODNE
Cemu strtok kada imas sscanf?
Naslov: Odg: Strtok
Poruka od: .бутиган poslato Februar 15, 2018, 01:51:45 PRE PODNE
Citat: .ксундер poslato Februar 14, 2018, 22:06:23 POSLE PODNE
Cemu strtok kada imas sscanf?

hardcore mode?

koristi sscanf