[AJUDA] comando strtok(cmdtext, idx) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] comando strtok(cmdtext, idx) (
/showthread.php?tid=249003)
[AJUDA] comando strtok(cmdtext, idx) -
douglasmonteiro - 16.04.2011
if(strcmp(cmd,"/servico",true, 10) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
}
if(strcmp(tmp,"taxi",true,strlen(tmp)) == 0)
{
}
return 1;
}
-------------
E ae pessoal beleza, esse meu codigo em cima quando o cara digita /servico estб lendo as duas condiзхes if, sendo que tem que ler somente uma, a primeira. Digitando /servico taxi teria que pegar a segunda.
tt
Douglas.
Re: [AJUDA] comando strtok(cmdtext, idx) -
zSuYaNw - 16.04.2011
pawn Код:
if(strcmp(cmd,"/servico",true, 10) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return 0;
}
if(strcmp(tmp,"taxi",true,strlen(tmp)) == 0)
{
return 0;
}
return 1;
}
Re: [AJUDA] comando strtok(cmdtext, idx) -
douglasmonteiro - 16.04.2011
vlws ae, era isso mesmo...