create an account.
#6

pawn Код:
CMD:createaccount(playerid, params[])
{
    new sP[MAX_PLAYER_NAME + 1], sV[34 + 1];
    if(sscanf(params, "s[MAX_PLAYER_NAME]s[35]", 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;
}
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: 1 Guest(s)