SA-MP Forums Archive
Register cmd problem - 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: Register cmd problem (/showthread.php?tid=319573)



Register cmd problem - Face9000 - 19.02.2012

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?


Re: Register cmd problem - Madd Kat - 19.02.2012

weird

try

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



Re: Register cmd problem - emokidx - 19.02.2012

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


Re: Register cmd problem - JhnzRep - 19.02.2012

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


Re: Register cmd problem - Face9000 - 19.02.2012

Thanks,fixed.