NEeds Tutarial for CMD without STROTK and SSCANF!!
#1

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!!
Reply
#2

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

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

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;
 }
Reply
#5

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.
Reply
#6

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!!
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)