Unknown command
#1

Why does it says "Server unknown command" ?...

Command work if I don't insert player's ID or Name so I recieve error message but when I enter ID or Name it says "Server Unknown Command" Why?

pawn Код:
if (strcmp("/csb", cmdtext, true, 10) == 0) // Check seatbelt
    {
        new tmp[256];
        new giveplayerid;
        tmp = strtok(cmdtext, idx);
        giveplayerid = ReturnUser(tmp);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, -1, "{FF6A22}INFO: {FFFFFF}/csb [playerid/PartOfName]");
            return 1;
        }
        if(SeatBelt[giveplayerid] == 0)
        {
            SendClientMessage(playerid, -1, "{00FF00}INFO: {FFFFFF}Players is buckled up");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "{FF6A22}INFO: {FFFFFF}Player's seatbelt isn't buckled up.");
        }
        return 1;
    }
Reply
#2

Use SSCANF.
Also, strcmp is a little out of date I'd advise you use zCMD. Much easier etc.
Reply
#3

I know SSCANF + ZCMD is easier and faster but I need to do this with strcmp for someone so do you maybe know what is wrong?
Reply
#4

Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)