Command problem
#1

What's the problem with this ?
if any one can send me an example of cmd like that thatwill help me to fix my errors thnks
Код:
    if(strcmp(cmd, "/craft", true) == 0)
    {
        new choice[32];
        if(strcmp(strtok, "s[32]", choice))
        {
            SendClientMessage(playerid, DENN, "[SERVER] Usage: /craft [bate/knife]");
            return 1;
        }
        if(strcmp(choice, "bate", true) == 0)
        {
//blabla
        return 1;
        }
        else if(strcmp(choice, "knife", true) == 0)
        {
//bla bla
        return 1;
        }
        return 1;
    }
Reply
#2

try this

Код:
    if(strcmp(cmd, "/craft", true) == 0)
    {
        new choice[32];
        choice = strtok(cmdtext, [the index variable u used earlier]);
        if(!strlen(choice))
        {
            SendClientMessage(playerid, DENN, "[SERVER] Usage: /craft [bate/knife]");
            return 1;
        }
        if(strcmp(choice, "bate", true) == 0)
        {
                  //blabla
                  return 1;
        }
        else if(strcmp(choice, "knife", true) == 0)
        {
                 //bla bla
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)