[Problem] y_stringhash + command change nick to "setnick"...
#1

Hello. I've an problem with zcmd + y_stringhash (or simply I don't know how to use it properly).

So... when I write /command setnick <new nick> this change my nick on "setnick".

Command is below:
pawn Код:
CMD:command(userid, params[])
{
    if(isnull(params)) return SendClientMessage(userid, -1, "/command [test/mature/setnick]");
    switch(YHash(params))
    {
        case _H<test>: SendClientMessage(userid, -1, "Test was purchased."); // This works...
        case _H<mature>: SendClientMessage(userid, -1, "This message is for mature only!"); // This works...
        case _H<setnick>: // This not works...
        {
            new Nick[MAX_PLAYER_NAME], Table[96];
            if(strlen(Nick) > MAX_PLAYER_NAME) return SendClientMessage(userid, -1, "Nick's too long.");
            SetPlayerName(userid, params);
            format(Table, sizeof Table, "Your nickname is now %s.", params);
            SendClientMessage(userid, -1, Table);
        }
    }
    return 1;
}
What I'm doing bad?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)