"Sub Commands" in ZCMD
#5

Actually you can ignore what I've said about the array sizes, you can set them to whatever makes you feel comfortable, here's an example.

pawn Код:
CMD:house(playerid, params[]) {
    new param[20];
    if (sscanf(params, "s[20]", param))
    {
        if (!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "USAGE: /(h)ouse [buy | sell]");
        else return SCM(playerid, COLOR_RED, "USAGE: /(h)ouse [create | setowner | delowner | delete | buy | sell]");
    }
    if (!strcmp(param, "create", true, 6))
    {
        new sub[20];
        if (PlayerInfo[playerid][pInHouse] == -1) return SCM(playerid, COLOR_RED, "You have to be inside an house.");
        if (sscanf(params, "s[20]s[20]", param, sub))
        {
            // Blahblah
            return 1;
        }
        // sscanf for other params goes here...
    }
    return 1;
}
Reply


Messages In This Thread
"Sub Commands" in ZCMD - by Verbal - 16.05.2012, 17:31
Re: "Sub Commands" in ZCMD - by iRage - 16.05.2012, 17:39
Re: "Sub Commands" in ZCMD - by Verbal - 16.05.2012, 17:40
AW: "Sub Commands" in ZCMD - by EthanR - 16.05.2012, 17:43
Re: "Sub Commands" in ZCMD - by iRage - 16.05.2012, 17:43
Re: "Sub Commands" in ZCMD - by mprofitt - 16.05.2012, 17:46
Re: "Sub Commands" in ZCMD - by Verbal - 16.05.2012, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)