Mysql saving won't work
#1

Well, I made some dialogs such as a race and age dialog. For some reason, they do not save. As the thread shows, I am using mysql. I need help trying to figure out why this won't work. Under OnDialogResponse:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_AGE)
    {
        new string[20], age;
        age = strval(inputtext);
        if(!response) return ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age", "Error: You cannot cancel out of this dialog\nPlease specify an age below","Continue","Cancel");
        if(age > 18 && age < 70)
        {
            format(string, sizeof(string), "Your age was set to %i", age);
            SendClientMessage(playerid, COLOR_WHITE, string);
            PlayerInfo[playerid][pAge] = age;
            ShowPlayerDialog(playerid,DIALOG_RACE,DIALOG_STYLE_INPUT, "Race", "Specify a race below! (15 chars)","Continue","Cancel");
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "You must specify an age that is above 18 and below 70");
    }
    if(dialogid == DIALOG_RACE)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_RACE,DIALOG_STYLE_INPUT, "Race", "You must type a race in below!","Continue","Cancel");
        if(strlen(inputtext) < 15 || strlen(inputtext) > 4)
        {
            new string[40];
            format(string, sizeof(string), "Your race was set to %s", inputtext);
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(PlayerInfo[playerid][pRace], 15, "%s", inputtext);
            ShowPlayerDialog(playerid,DIALOG_IMPRISONMENT,DIALOG_STYLE_INPUT, "Imprisonment", "Write why you were imprisoned (20 chars)","Continue","Cancel");
        }
        else return ShowPlayerDialog(playerid,DIALOG_RACE,DIALOG_STYLE_INPUT,"Race", "Your race must be lower then 15 characters long and greater then 4 characters long!","Continue","Cancel");
    }
    if(dialogid == DIALOG_IMPRISONMENT)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_IMPRISONMENT,DIALOG_STYLE_INPUT, "Imprisonment", "You must write why you were imprisoned (20 chars)","Continue","Cancel");
        if(strlen(inputtext) > 4 || strlen(inputtext) < 20)
        {
            new string[45];
            format(string, sizeof(string), "Your reason was set to %s", inputtext);
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(PlayerInfo[playerid][pImprisonment], 20, "%s", inputtext);
            ShowPlayerDialog(playerid,DIALOG_FEATURES,DIALOG_STYLE_INPUT, "Features", "Please write down some physical features of your character","Continue","Cancel");
        }
        else return ShowPlayerDialog(playerid,DIALOG_IMPRISONMENT,DIALOG_STYLE_INPUT, "Imprisonment", "The desired reason must be greater then 4 characters long\n and less then 20 characters","Continue","Cancel");
    }
    if(dialogid == DIALOG_FEATURES)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_IMPRISONMENT,DIALOG_STYLE_INPUT, "Features", "YYou must write some  physical features about your player!","Continue","Cancel");
        if(strlen(inputtext) < 30 || strlen(inputtext) > 10)
        {
            new string[55];
            format(string, sizeof(string), "Features: %s", inputtext);
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(PlayerInfo[playerid][pFeatures], 30, "%s", inputtext);
            SendClientMessage(playerid, COLOR_WHITE, "You have completed the faishdkjasgh");
            SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
            SpawnPlayer(playerid);
        }
        else return ShowPlayerDialog(playerid, DIALOG_FEATURES, DIALOG_STYLE_INPUT, "Features", "The features must be less then 30 characters long and greater then 10 characters","Continue","Cancel");
    }
    return 1;
}
And when I go into my phpmyadmin to check my player, the areas are empty.

Thanks in advance if you can help,
Kindred.
Reply


Messages In This Thread
Mysql saving won't work - by Kindred - 07.04.2012, 23:54
Re: Mysql saving won't work - by [DOG]irinel1996 - 07.04.2012, 23:56
Re: Mysql saving won't work - by Kindred - 08.04.2012, 00:10
Re: Mysql saving won't work - by [DOG]irinel1996 - 08.04.2012, 00:25
Re: Mysql saving won't work - by Kindred - 08.04.2012, 00:29
Re: Mysql saving won't work - by [DOG]irinel1996 - 08.04.2012, 00:30
Re: Mysql saving won't work - by Kindred - 08.04.2012, 01:17
Re: Mysql saving won't work - by [DOG]irinel1996 - 08.04.2012, 01:19
Re: Mysql saving won't work - by Kindred - 08.04.2012, 01:38
Re: Mysql saving won't work - by [DOG]irinel1996 - 08.04.2012, 10:54

Forum Jump:


Users browsing this thread: 1 Guest(s)