SA-MP Forums Archive
Unknown command - 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: Unknown command (/showthread.php?tid=503013)



Unknown command - Lajko1 - 27.03.2014

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;
    }



Re: Unknown command - Dokins - 27.03.2014

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


Re: Unknown command - Lajko1 - 27.03.2014

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?


Re: Unknown command - Lajko1 - 27.03.2014

Fixed.