HELP DIALOG
#1

- Please help me. The problem here is when I use the command ((/xayeshop)) will appear DIALOG_STYLE_INPUT, now I will enter the coordinates ((interior)) of the house. After finishing press "Agree" will appear DIALOG_STYLE_MSGBOX, which has to coordinates just ((interior)) just now.

- But now when I enter the coordinates into DIALOG_STYLE_INPUT finished DIALOG_STYLE_MSGBOX it does not show the coordinates you just entered.

- Sorry, my english is not good.

- This my code:
Code:
if(listitem == 0) // House
            {
                if((PlayerInfo[playerid][pCredits] <= 499))
                {
                    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban khong du 500 Credits de su dung dich vu nay.");
                }
                else
                {
                    new szMessage[128], Player;
                    format(szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits`=%d WHERE `id` = %d", PlayerInfo[Player][pCredits], GetPlayerSQLId(Player));
                     mysql_function_query(MainPipeline, szMessage, false, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
                     PlayerInfo[playerid][pCredits] -= 500;
                     
                    new dvhouse = strval(inputtext);
                    ShowPlayerDialog(playerid, DIALOG_DVHOUSE, DIALOG_STYLE_INPUT, "Dich Vu House", "Nhap Toa Do House\nPhi dich vu: 500 Credits\nToa do House: https://grovestreetngg.forumotion.com/t2...-list\nToa do bao gom: [X] [Y] [Z] [Interior]", "Dong Y", "Thoat");
                    SetPVarString(playerid, "DichVuHouse", dvhouse);
                }
            }
Code:
if(dialogid == DIALOG_DVHOUSE)
    {
        if(response)
        {
            dvhouse = GetPVarString(playerid, "DichVuHouse");
            format(string, sizeof(string), "Toa Do: %d", dvhouse);
            ShowPlayerDialog(playerid, DIALOG_DVHOUSE2, DIALOG_STYLE_MSGBOX, "Xac Nhan Xay", string, "Dong Y", "Tu choi");
        }
    }
- Error:
Code:
./includes/KG EDIT.pwn(120342) : error 035: argument type mismatch (argument 3)
./includes/KG EDIT.pwn(120340) : warning 204: symbol is assigned a value that is never used: "dvhouse"
./includes/KG EDIT.pwn(120416) : error 017: undefined symbol "dvhouse"
./includes/KG EDIT.pwn(120416) : warning 202: number of arguments does not match definition
./includes/KG EDIT.pwn(120416) : warning 202: number of arguments does not match definition
./includes/KG EDIT.pwn(120417) : error 017: undefined symbol "dvhouse"
Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase


3 Errors.
- Video Error Ingame:
https://www.youtube.com/watch?v=hi-DD_Lcj3s
Reply
#2

Help me, who can see my code and fix it?
Reply
#3

Replace this line:
pawn Code:
dvhouse = GetPVarString(playerid, "DichVuHouse");
With this.
pawn Code:
new dvhouse[MAX_PLAYER_NAME+1];
GetPVarString(playerid, "DichVuHouse", dvhouse, sizeof(dvhouse));
Reply
#4

Quote:
Originally Posted by Yasef99
View Post
Replace this line:
pawn Code:
dvhouse = GetPVarString(playerid, "DichVuHouse");
With this.
pawn Code:
new dvhouse[MAX_PLAYER_NAME+1];
GetPVarString(playerid, "DichVuHouse", dvhouse, sizeof(dvhouse));
Code:
(120327)    if(listitem == 0) // House
(120328)    {
(120329)        if((PlayerInfo[playerid][pCredits] <= 499))
(120330)        {
(120331)            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban khong du 500 Credits de su dung dich vu nay.");
(120332)        }
(120333)        else
(120334)        {
(120335)            new szMessage[128], Player;
(120336)            format(szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits`=%d WHERE `id` = %d", PlayerInfo[Player][pCredits], GetPlayerSQLId(Player));
(120337)            mysql_function_query(MainPipeline, szMessage, false, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
(120338)            PlayerInfo[playerid][pCredits] -= 500;
(120339)                 	
(120340)            new dvhouse = strval(inputtext);
(120341)            ShowPlayerDialog(playerid, DIALOG_DVHOUSE, DIALOG_STYLE_INPUT, "Dich Vu House", "Nhap Toa Do House\nPhi dich vu: 500 Credits\nToa do House: https://grovestreetngg.forumotion.com/t2...-list\nToa do bao gom: [X] [Y] [Z] [Interior]", "Dong Y", "Thoat");
(120342)            SetPVarString(playerid, "DichVuHouse", dvhouse);
(120343)        }
(120344)    }
- Error at line 120342 and 120340
Code:
./includes/KG EDIT.pwn(120342) : error 035: argument type mismatch (argument 3)
./includes/KG EDIT.pwn(120340) : warning 204: symbol is assigned a value that is never used: "dvhouse"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

Help me, please
Reply
#6

Since you need to show the inputted text inside a MSG box dialog you need to do it like this:
Code:
new input[MAX_PLAYERS][40];
if(listitem == 0) // House
            {
                if((PlayerInfo[playerid][pCredits] <= 499))
                {
                    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban khong du 500 Credits de su dung dich vu nay.");
                }
                else
                {
                    new szMessage[128], Player;
                    format(szMessage, sizeof(szMessage), "UPDATE `accounts` SET `Credits`=%d WHERE `id` = %d", PlayerInfo[Player][pCredits], GetPlayerSQLId(Player));
                     mysql_function_query(MainPipeline, szMessage, false, "OnQueryFinish", "ii", SENDDATA_THREAD, Player);
                     PlayerInfo[playerid][pCredits] -= 500;
                     
                    input[playerid] = inputtext;
                    ShowPlayerDialog(playerid, DIALOG_DVHOUSE, DIALOG_STYLE_INPUT, "Dich Vu House", "Nhap Toa Do House\nPhi dich vu: 500 Credits\nToa do House: https://grovestreetngg.forumotion.com/t2...-list\nToa do bao gom: [X] [Y] [Z] [Interior]", "Dong Y", "Thoat");
                    SetPVarString(playerid, "DichVuHouse", dvhouse);
                }
            }
Code:
if(dialogid == DIALOG_DVHOUSE)
{
        if(response)
        {
            new housestring[40];
            format(housestring, sizeof(housestring), "Toa Do: %s", input);
            ShowPlayerDialog(playerid, DIALOG_DVHOUSE2, DIALOG_STYLE_MSGBOX, "Xac Nhan Xay", housestring, "Dong Y", "Tu choi");
        }
}
You need to put inputtext inside the string that will be shown on the dialog later because that is what the player typed before.
And also if you want to convert that string to a integrer/float you can just use strval(inputtext) because you have more values inside one string so you will need to use sscanf.
Reply
#7

- I don't complete with your code. ( Whyy
Reply
#8

Help me.
Reply
#9

Bruh post the errors
Reply
#10

wait for me 20min
Reply


Forum Jump:


Users browsing this thread: