SA-MP Forums Archive
[Problem] y_stringhash + command change nick to "setnick"... - 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: [Problem] y_stringhash + command change nick to "setnick"... (/showthread.php?tid=346083)



[Problem] y_stringhash + command change nick to "setnick"... - Dystans - 27.05.2012

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?