Dialog response
#1

Well, I've got this problem where for some reason the dialog response is not coming to 'part 4'

Код:
if(dialogid == 0)
    {
        if(response)
        {
            new Query[500], DBResult:result;
            if(strlen(inputtext) > 24 || strlen(inputtext) < 3)
            {
                ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "{FFFFFF}Error occured", "WRONG INPUT!\nPlease re write it", "Register", "Leave");
            }
            else
            {
                format(Query, sizeof(Query), "INSERT INTO `USERS` (`NAME`, `PASSWORD`, `IP`, `MONEY`, `SCORE`, `KILLS`, `DEATHS`, `ADMINLEVEL`, `VIPLEVEL`, `GENERAL`) VALUES('%s', '%s', '%s', '10000', '0', '0', '0', '0', '0', '0')", DB_Escape(PlayerName(playerid)), DB_Escape(inputtext), DB_Escape(PlayerIP(playerid)));
                result = db_query(BFLSDB, Query);
                if(result)
				{
				    print("Came to part 4"); // it won't come to this part
					SendClientMessage(playerid, -1, ""BLUE"You have registered successfully. You are added into our database"), printf("SQLITE: %s successfully registered", PlayerName(playerid));
     				foreach(Player, i)
					{
					    static str[128];
						if(PlayerInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) format(str,sizeof(str), "%s(%d) has {00FF00}registered {CCCCCC}to the server. IP: {00FF00}%s", PlayerName(playerid), playerid, PlayerIP(playerid)), SendClientMessage(i, 0xCCCCCCAA, str);
						else if(PlayerInfo[i][Admin] == 0 || !IsPlayerAdmin(i)) format(str,sizeof(str), "%s(%d) has {00FF00}registered {CCCCCC}to the server. {00FF00}Welcome him and help him!", PlayerName(playerid), playerid), SendClientMessage(i, 0xCCCCCCAA, str);
                        str = "/0";
					}
				}
			    else if(!result) SendClientMessage(playerid, ERROR_COLOR, "Registration failed, you could not be added into our database."), printf("SQLITE: %s failed to register", PlayerName(playerid));
            }
        }
        else return printf("%s has been kicked from OnDialogResponse - register", PlayerName(playerid)), Kick(playerid);
    }
Any ideas why does it happen?
Reply
#2

I've just checked the database with SQLite viewer and it appears the saved data is being mixed, looks like this:

Name:
Loc.182.685.
Password:
Loc.182.685.
IP:
Loc.182.685.

It just re-uses the same data in those 3 rows, other rows work fine, any idea how to fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)