ZCMD question... [newbie]
#2

The params[] in zcmd isn't there for show, it's the value that represents the string a player typed in.
pawn Код:
CMD:door(playerid, params[])
{
    if(!strcmp(params, "open", true)) {
        // code if they typed open
        return 1;
    }

    else if (!strcmp(params, "close", true)) {
        // code if they typed close
        return 1;
    }

    else {
        SendClientMessage(playerid, -1, "USAGE: /door [open or close]");
    }
    return 1;
}
ofc, you can optimize it with isnull(), but I just wanted to get the point across
Reply


Messages In This Thread
ZCMD question... [newbie] - by Squirrel - 18.02.2013, 03:01
Re: ZCMD question... [newbie] - by ReneG - 18.02.2013, 03:07
Re: ZCMD question... [newbie] - by Squirrel - 18.02.2013, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)