SA-MP Forums Archive
NEeds Tutarial for CMD without STROTK and SSCANF!! - 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)
+--- Thread: NEeds Tutarial for CMD without STROTK and SSCANF!! (/showthread.php?tid=334893)



NEeds Tutarial for CMD without STROTK and SSCANF!! - Andrew97 - 16.04.2012

I need a Tutatial for CMDS without STROTK and so... I think it is better to understand and Easy to Know it!! and More Easy to make a CMD!!


Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - RollTi - 16.04.2012

creating such as /ban [playerid] [reason] is not possible to make without strtok or sscanf2


Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - Andrew97 - 16.04.2012

but STRCMP is more Easier than Strtok!! I really can't understand this Strtok!!


Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - James Coral - 16.04.2012

Here it is:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx;
    new cmd[256];
   
    cmd = strtok(cmdtext, idx);

    if(strcmp(cmd, "/help", true) == 0) {
    //HELP COMMANDS
        return 1;
    }
      return 0;
 }



Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - iggy1 - 16.04.2012

Quote:
Originally Posted by Andrew97
Посмотреть сообщение
but STRCMP is more Easier than Strtok!! I really can't understand this Strtok!!
Strcmp compares strings and strtok splits strings into tokens. Shouldn't really compare the two.

Sscanf is the easiest way to split strings, anything else is a lot more complicated and not to mention slower. You will have a very hard time finding tutorials for splitting strings that don't use either sscanf or strtok.


Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - Andrew97 - 16.04.2012

I will Not GIVE UP And I will Learn SSCANF and STRTOK GOD BE WITH ME LOOL!!


I was Hoping to find a another way to make CMDS without STRTOK and SSCANF!!


Re: NEeds Tutarial for CMD without STROTK and SSCANF!! - Andrew97 - 16.04.2012

OMG +++++++++++11111111 for you lool