[AJUDA]LoginBox
#4

pawn Код:
dcmd_register(playerid,params[])
{
    #pragma unused params
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already registered and logged in.");
    if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"ACCOUNT: This account already exists, please use '/login [password]'.");
    ShowPlayerDialog(playerid,registro, DIALOG_STYLE_INPUT,"Registrar","Digite uma senha para registrar", "Ok,"Cancelar");
    return 1;
}
   

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == registro)
    {
        if(response)
        {
            if(strlen(inputtext) < 4 || strlen(inputtext) > 20) return SendClientMessage(playerid,red,"
ACCOUNT:Password lenght must be greater than three characters");
            if(udb_Create(PlayerName2(playerid),inputtext))
            {
                new file[256],name[MAX_PLAYER_NAME, tmp3[100];
                new strdate[20], year, month, day; getdate(year, month, day);
                GetPlayerName(playerid,name,sizeof(name)); format(file(sizeof(file),"
/ladmin/users/%s.sav",udb_encode(name));
                GetPlayerIp(playerid,tmp3,100); dini_Set(file,"
ip",tmp3);
 //             dini_Set(file,"
password",params);
                dUserSetINT(PlayerName2(playerid)).("
registered",1);
                format(strdate, sizeof(strdate), "
%d/%d/%d",day,month,year);
                dini_Set(file,"
RegisteredDate",strdate);
                dUserSetINT(PlayerName2(playerid)).("
loggedin",1);
            dUserSetINT(PlayerName2(playerid)).("
banned",0);
            dUserSetINT(PlayerName2(playerid)).("
level",0);
            dUserSetINT(PlayerName2(playerid)).("
LastOn",0);
            dUserSetINT(PlayerName2(playerid)).("
money",0);
            dUserSetINT(PlayerName2(playerid)).("
kills",0);
            dUserSetINT(PlayerName2(playerid)).("
deaths",0);
            dUserSetINT(PlayerName2(playerid)).("
hours",0);
            dUserSetINT(PlayerName2(playerid)).("
minutes",0);
            dUserSetINT(PlayerName2(playerid)).("
seconds",0);
            PlayerInfo[playerid][LoggedIn] = 1;
            PlayerInfo[playerid][Registered] = 1;
            SendClientMessage(playerid, green, "
ACCOUNT: You are now registered, and have been automaticaly logged in");
            PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
            return 1;
    }
        return 1;
}
Vк se funciona, se nгo, posta os erros e eu debugo.

~r0n4ld0
Reply


Messages In This Thread
[AJUDA]LoginBox - by RockFire - 12.03.2011, 13:15
Re: [AJUDA]LoginBox - by DartakousLien - 12.03.2011, 14:27
Re: [AJUDA]LoginBox - by RockFire - 12.03.2011, 14:57
Re: [AJUDA]LoginBox - by vitorhnn - 12.03.2011, 15:30

Forum Jump:


Users browsing this thread: 1 Guest(s)