Not getting kicked when cancelling dialog
#10

Try this:
pawn Код:
case DIALOG_LOGIN:
        {
            if (!response)
            {
                Kick(playerid);
                return 1;
            }
            if(response) // Pressed ENTER or clicked 'Login' button
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    printf("Loading player stats..");
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    if(PlayerInfo[playerid][pTutorialDone] == 0) return SetTimerEx("AgeSetup", 1000, false, "i", playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetSpawnInfo(playerid, 0, 26, -2210.7092,-2450.5549,30.4495, 52.1403, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                    LoadFightingStyle(playerid);
                    FadeColorForPlayer(playerid,0,0,0,255,0,0,0,0,15,0);
                    SCM(playerid, COLOR_WHITE, "You have successfully logged in.");
                    TogglePlayerSpectating(playerid, false);
                    PlayerLogged[playerid] = true;
                    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                    new playername[24];
                    GetPlayerName(playerid, playername, sizeof(playername));

                    for(new i=1; i < MAX_DVEHICLES; i++)
                    {
                        if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], playername) == 0)
                        {
                            UpdateVehicle(i, 0);
                        }
                    }
                    if(PlayerInfo[playerid][pBanned] == 1)
                    {
                        SCM(playerid, COLOR_LIGHTRED, "AdmCmd: You have been banned for logging into a banned account.");
                        SetTimerEx("UnsetBan", 500, 0, "i", playerid);
                    }
                }
                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;
            }
        }
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)