dialog help
#1

i want to do that when player register,Then it's show him the login dialog.
and i want that when player try to login and the pass incorrect the login dialog will show him 3 times
and then he get kick..
PHP код:
 if (!dini_Exists(file))
    {
        
ShowPlayerDialog(playerid,2009,DIALOG_STYLE_INPUT,"Register","Type your password below in order to register to the server.","Register","Cancel");
    }
    if(
fexist(file))
    {
           
ShowPlayerDialog(playerid,2010,DIALOG_STYLE_INPUT,"Login","Type your password below in order to login to the server.","Login","Cancel");
    } 
Reply
#2

pawn Код:
new Chance[MAX_PLAYERS];

//Inside your dialog if wrong
if(Chance[playerid] == 3) Kick(playerid);
else Chance[playerid] ++;
Reply
#3

thanks man.
but i dont know how to put it inside.
PHP код:
if (!dini_Exists(file))
    {
    else 
Chance[playerid] ++;
    {
    
ShowPlayerDialog(playerid,2009,DIALOG_STYLE_INPUT,"Register","Type your password below in order to register to the server.","Register","Cancel");
    }
    }
    if(
fexist(file))
    {
    if(
Chance[playerid] == 3Kick(playerid);
    {
       
ShowPlayerDialog(playerid,2010,DIALOG_STYLE_INPUT,"Login","Type your password below in order to login to the server.","Login","Cancel");
       }
       }
    return 
1;

i do like this
Reply
#4

Show your OnDialogResponse.
Reply
#5

PHP код:
        if(dialogid == 2009)
        {
            if(
response)
            {
                if (
PLAYERLIST_authed[playerid]) return SendClientMessage(playeridRed"You are already logged in.");

                if (
udb_Exists(PlayerName(playerid))) return SendClientMessage(playeridOrange"This name is already taken.");

                if (
udb_Create(PlayerName(playerid),inputtext))
                {
                    
dUserSetINT(PlayerName(playerid)).("Score"0);
                    
dUserSetINT(PlayerName(playerid)).("AdminLevel"0);
                    
dUserSetINT(PlayerName(playerid)).("PlayerLevel"0);
                    
dUserSetINT(PlayerName(playerid)).("Kills"0);
                    
dUserSetINT(PlayerName(playerid)).("Deaths"0);
                    return 
SendClientMessage(playeridRed"Your account has been created.");
                }
            }
            if(!
response)
            {
                
SendClientMessage(playerid,Red,"Canceled");
            }
            return 
1;
        }
        if(
dialogid == 2010)
        {
            if(
response)
            {
                if (
PLAYERLIST_authed[playerid]) return SendClientMessage(playeridOrange"You are already logged in");
                if (!
udb_Exists(PlayerName(playerid))) return SendClientMessage(playeridOrange"That account is not yet registerd.");
                if (
udb_CheckLogin(PlayerName(playerid), inputtext))
                    {
                        
SetPlayerScore(playeriddUserINT(PlayerName(playerid)).("Score")-GetPlayerScore(playerid));
                        
AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
                        
PlayerLevel[playerid] = dUserINT(PlayerName(playerid)).("PlayerLevel");
                        
AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
                        
Deaths[playerid] = dUserINT(PlayerName(playerid)).("Deaths");
                        
Kills[playerid] = dUserINT(PlayerName(playerid)).("Kills");
                        
PLAYERLIST_authed[playerid]=true;
                        
Logged[playerid] =1;
                        return 
SendClientMessage(playeridRed"You are now logged in.");
                     }
                return 
SendClientMessage(playeridRed"Login Failed.");
            }
            if(!
response)
            {
                
SendClientMessage(playerid,Red,"Canceled");
            }
            return 
1;
        } 
Reply
#6

pawn Код:
if(dialogid == 2009)
        {
            if(response)
            {
                if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid, Red, "You are already logged in.");
                if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, Orange, "This name is already taken.");
                if (udb_Create(PlayerName(playerid),inputtext))
                {
                    dUserSetINT(PlayerName(playerid)).("Score", 0);
                    dUserSetINT(PlayerName(playerid)).("AdminLevel", 0);
                    dUserSetINT(PlayerName(playerid)).("PlayerLevel", 0);
                    dUserSetINT(PlayerName(playerid)).("Kills", 0);
                    dUserSetINT(PlayerName(playerid)).("Deaths", 0);
                    SendClientMessage(playerid, Red, "Your account has been created.");
                    ShowPlayerDialog(playerid,2010,DIALOG_STYLE_INPUT,"Login","Type your password below in order to login to the server.","Login","Cancel");
                }
            }
            else
            {
                SendClientMessage(playerid,Red,"Canceled");
            }
            return 1;
        }
        if(dialogid == 2010)
        {
            if(response)
            {
                if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid, Orange, "You are already logged in");
                if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, Orange, "That account is not yet registerd.");
                if (udb_CheckLogin(PlayerName(playerid), inputtext))
                {
                    SetPlayerScore(playerid, dUserINT(PlayerName(playerid)).("Score")-GetPlayerScore(playerid));
                    AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
                    PlayerLevel[playerid] = dUserINT(PlayerName(playerid)).("PlayerLevel");
                    AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
                    Deaths[playerid] = dUserINT(PlayerName(playerid)).("Deaths");
                    Kills[playerid] = dUserINT(PlayerName(playerid)).("Kills");
                    PLAYERLIST_authed[playerid]=true;
                    Logged[playerid] =1;
                    SendClientMessage(playerid, Red, "You are now logged in.");
                }
                else
                {
                    SendClientMessage(playerid, Red, "Login Failed.");
                    Chance[playerid]++;
                    if(Chance[playerid] == 3) return Kick(playerid);
                    else ShowPlayerDialog(playerid,2010,DIALOG_STYLE_INPUT,"Login","Type your password below in order to login to the server.","Login","Cancel");
                }
            }
            else
            {
                SendClientMessage(playerid,Red,"Canceled");
            }
            return 1;
        }
Reply
#7

tnx man your'e pro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)