Register cmd problem
#1

Hello,i've a problem with this cmd,the params dont work.

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;
}
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?
Reply
#2

weird

try

pawn Код:
if(!strlen(params)>0)
Reply
#3

pawn Код:
if(isnull(params)
?_?
Reply
#4

I recommend making a dialog, as /register [password] can be found in logs.
Reply
#5

Thanks,fixed.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)