create an account.
#8

Quote:

CMD:createaccount(playerid, params[])
{
new sP[MAX_PLAYER_NAME + 1], sV[34 + 1];
if(sscanf(params, "ss", uP, sV)) return SendClientMessage(playerid, -1, "USAGE: /createaccount [Name] [Password]");
if(strlen(sP) < 3 || strlen(sV) > MAX_PLAYER_NAME) return SendClientMessage(playerid, -1, "ERROR: Invalid name lenghth");
if(strlen(sV) < 5 || strlen(sV) > 34) return SendClientMessage(playerid, -1, "ERROR: Invalid password lenghth");


SetPlayerName(playerid, sP);

new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "data");
INI_WriteInt(File, "Password", udb_hash(sV));
INI_WriteInt(File, "Cash", 0);
INI_WriteInt(File, "Admin", 0);
INI_WriteInt(File, "Kills", 0);
INI_WriteInt(File, "Deaths", 0);
INI_Close(File);

SendClientMessage(playerid, -1, "Account created!");
return 1;
}

I can create accounts now but lets say I wanna create an account named Lean_Lean, I do /createaccount Lean_Lean changeme then the name im using IN GAME changes to Lean_Lean and the password also changes.
Reply


Messages In This Thread
create an account. - by lean1337 - 02.02.2013, 16:31
Re: create an account. - by Roach_ - 02.02.2013, 16:39
Re: create an account. - by lean1337 - 02.02.2013, 16:40
Re: create an account. - by Roach_ - 02.02.2013, 16:50
Re: create an account. - by lean1337 - 02.02.2013, 17:00
Re: create an account. - by Roach_ - 02.02.2013, 17:17
Re: create an account. - by lean1337 - 02.02.2013, 20:58
Re: create an account. - by lean1337 - 04.02.2013, 12:06

Forum Jump:


Users browsing this thread: 2 Guest(s)