27.05.2012, 10:01
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:
What I'm doing bad?
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;
}