Dialog help
#1

The following code throws no errors nor warnings, but does not work whatsoever.
Only the ZCMD command works, which in turn should lead to the dialogresponses, but no response occurs when I choose an item from inside the game.
Code:
pawn Код:
//dialogs:
if(dialogid == VIPWALKSTYLE)
    {
        if(response)
        {
            if(listitem >= 0 && listitem < 13)
            {
                SetPlayerWalkingStyle(playerid, listitem+2);
                SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                SaveWS(playerid);
                return 1;
            }
            else if(listitem == 13)
            {
                SetPlayerWalkingStyle(playerid, 0);
                SendClientMessage(playerid, COLOR_WHITE, "You have removed your current walking style.");
                SaveWS(playerid);
                return 1;
            }
            return SendClientMessage(playerid, COLOR_WHITE, "BUG #1.");
        }
    }
    if(dialogid == WALKSTYLE && response)
    {

        if(listitem < 5)
        {
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                    SetPlayerWalkingStyle(playerid, 2);
                    SaveWS(playerid);
                    return 1;
                }
                case 1:
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                    SetPlayerWalkingStyle(playerid, 3);
                    SaveWS(playerid);
                    return 1;
                }
                case 2:
                {
                    SetPlayerWalkingStyle(playerid, 5);
                    SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                    SaveWS(playerid);
                    return 1;
                }
                case 3:
                {
                    SetPlayerWalkingStyle(playerid, 8);
                    SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                    SaveWS(playerid);
                    return 1;
                }
                case 4:
                {
                    SetPlayerWalkingStyle(playerid, 10);
                    SendClientMessage(playerid, COLOR_WHITE, "You have successfully changed your walking style.");
                    SaveWS(playerid);
                    return 1;
                }
            }
        }
        else
        {
            SetPlayerWalkingStyle(playerid, listitem);
            SendClientMessage(playerid, COLOR_WHITE, "You have removed your current walking style.");
            SaveWS(playerid);
            return 1;
        }
    }
Command:
pawn Код:
CMD:walkstyle(playerid, params[])
{
    if(PlayerInfo[playerid][pDonateRank] > 3)
    {
        ShowPlayerDialog(playerid, VIPWALKSTYLE, DIALOG_STYLE_LIST, "Walking Style", "Pedestrian\nGangster\nGangster II\nOld\nFat and Old\nFat\nLady\nLady II\nLady III\nLady IV\nDrunk\nBlind\nRemove current walk","OK","Cancel");
        return 1;
    }
    else
    {
        ShowPlayerDialog(playerid, WALKSTYLE, DIALOG_STYLE_LIST, "Walking Style", "Pedestrian\nGangster\nOld\nLady\nLady II\nRemove current walk","OK","Cancel");
        return 1;
    }
}

//stock SaveWS
stock SaveWS(playerid)
{
    new string[128], var[32];
    format(string, 128, "Accounts/%s_ws.cfg", GetPlayerNameEx(playerid));
    if(!fexist(string)) fcreate(string);
    new File:file;
    file = fopen(string, io_write);
    format(var, 32, "WalkingStyle=%d\n", GetPlayerWalkingStyle(playerid));fwrite(file, var);
    fclose(file);
    return 1;
}
All dialogs/commands were placed in the correct position(s).
Something is definitely wrong from the dialogs, what is it? Thank you!
Reply


Messages In This Thread
Dialog help - by maramizo - 26.07.2012, 05:43
Re: Dialog help - by maramizo - 26.07.2012, 06:21
Re: Dialog help - by [KHK]Khalid - 26.07.2012, 06:30
Re: Dialog help - by Jikesh - 26.07.2012, 06:31
Re: Dialog help - by maramizo - 26.07.2012, 16:50
Re: Dialog help - by maramizo - 26.07.2012, 17:05
Re: Dialog help - by maramizo - 26.07.2012, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)