Problem level 0
#1

Hi all. I have a problem about new accounts. When i login with a new account, i have level 0. What i need to do for level 1 when i login with a new account?
i got no ideea
Reply
#2

Do you using register system with GUI ?
Reply
#3

with y_ini. everything is with Y_ini. level, money, rp, log/register system.
Reply
#4

You need this line:
pawn Код:
dini_IntSet(file, "Level",PlayerInfo[playerid][level] = 1);
But I don't know how to explain you where to put it
Reply
#5

Or you can use this code under OnPlayerConnect callback:
pawn Код:
if(PlayerInfo[playerid][level] == 0) PlayerInfo[playerid][level] = 1;
Reply
#6

I will try the second code. i have first code man...because i have level system. that code is already on my GM.
EDIT: is not working man
Reply
#7

Tadas it is Y_ini as he said not dini

BTW

is it when player register? if then put this under OnPlayerRegister

pawn Код:
if(PlayerInfo[playerid][thenameofyourlevelvar] < 1) {PlayerInfo[playerid][thenameofyourlevelvar]= 1;}
ex.
if(PlayerInfo[playerid][pLevel] < 1) {PlayerInfo[playerid][pLevel] = 1;}
Reply
#8

I don't have that line.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering in progress","You have entered an invalid password.\n"COL_BLUE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"RP",0);
               
                INI_Close(File);

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Registry has been successfully completed!","Ok","");
                        }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                                        ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\n""Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
where i put that code?
Reply
#9

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering in progress","You have entered an invalid password.\n"COL_BLUE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"RP",0);
                INI_WriteInt(File,"Level",1);
                INI_Close(File);

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Registry has been successfully completed!","Ok","");
                        }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                                        ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\n""Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Try this
Reply
#10

Tadas you kidding ) is wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)