19.02.2012, 15:27
Hello,i've a problem with this cmd,the params dont work.
If i do just /register,the server let me register with no password,when it's need to be the opposite. (/register password).
I use zcmd.What's wrong?
pawn Код:
CMD:register(playerid, params[])
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
if(!strlen(params)) return SendClientMessage(playerid, red, "Usage: /register [password]");
if(dini_Exists(file)) return SendClientMessage(playerid, red, "You are already registered! Use /login <password>");
dini_Create(file);
dini_IntSet(file, "hashPW", udb_hash(params));
dini_Set(file, "password", params);
dini_IntSet(file, "level", 0);
dini_IntSet(file, "score", GetPlayerScore(playerid));
dini_IntSet(file, "money", GetPlayerMoney(playerid));
new string[128];
format(string, 128, "You succesfully registered the nickname %s with password %s", pname, params);
SendClientMessage(playerid, yellow, string);
logged[playerid] = 1;
SendClientMessage(playerid, yellow, "You have been automatically logged in!");
return true;
}
I use zcmd.What's wrong?