SA-MP Forums Archive
STRTOK problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: STRTOK problem (/showthread.php?tid=124129)



STRTOK problem - adi360 - 28.01.2010

Hello ppl
Well i have a problem with strtrok..
Im kinda new to pawno and i used code from someone else
This is what i get

Код:
C:\Documents and Settings\Adi\Desktop\Desktop\SA-MP Scripting\pawno\WWPRG.pwn(726) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Adi\Desktop\Desktop\SA-MP Scripting\pawno\WWPRG.pwn(726) : error 033: array must be indexed (variable "tmp")
The Code:
Код:
   if (strcmp(cmdtext, "/heal", true) == 0)
{
new tmp[20],id;
tmp = strtok(cmdtext, index);
if(gTeam[playerid] != TEAM_CA) return SendClientMessage(playerid, 0xFF0000AA, "You need to be a medic to do that!");
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed! / Zosta?es' uzdrowiony/a!");
SendClientMessage(playerid, 0x00FF00AA, "Player healed / Osoba uzdrowiona!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found / Gracz nieznaleziony");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE/UZ.YCIE: /heal <playerid/idgracza>");
}
return 1;
}



Re: STRTOK problem - mansonh - 29.01.2010

you need to define it
https://sampwiki.blast.hk/wiki/Strtok