SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/01/2020, 04:25 AM   #1
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default HELP DIALOG

- 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/t26-house-interiors-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 (c) 1997-2006, ITB CompuPhase


3 Errors.
- Video Error Ingame:
https://www.youtube.com/watch?v=hi-DD_Lcj3s
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 12/01/2020, 04:35 AM   #2
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Question Re: HELP DIALOG

Help me, who can see my code and fix it?
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 12/01/2020, 04:50 AM   #3
Yasef99
Little Clucker
 
Join Date: Jun 2017
Posts: 30
Reputation: 0
Default Re: HELP DIALOG

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));
Yasef99 is offline   Reply With Quote
Old 13/01/2020, 09:46 AM   #4
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default Re: HELP DIALOG

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/t26-house-interiors-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 (c) 1997-2006, ITB CompuPhase


1 Error.
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 13/01/2020, 11:20 AM   #5
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default Re: HELP DIALOG

Help me, please
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 13/01/2020, 12:33 PM   #6
TokicMajstor
Huge Clucker
 
TokicMajstor's Avatar
 
Join Date: Oct 2018
Location: Bosnia And Herzegovina
Posts: 214
Reputation: 10
Default Re: HELP DIALOG

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/t26-house-interiors-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.
__________________

My work:
-MapTD - GTA SA Map on a TextDraw

https://forum.sa-mp.com/showthread.php?t=671806
TokicMajstor is offline   Reply With Quote
Old 14/01/2020, 03:15 AM   #7
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default Re: HELP DIALOG

- I don't complete with your code. ( Whyy
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 14/01/2020, 02:05 PM   #8
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default Re: HELP DIALOG

Help me.
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Old 14/01/2020, 02:23 PM   #9
TokicMajstor
Huge Clucker
 
TokicMajstor's Avatar
 
Join Date: Oct 2018
Location: Bosnia And Herzegovina
Posts: 214
Reputation: 10
Default Re: HELP DIALOG

Bruh post the errors
__________________

My work:
-MapTD - GTA SA Map on a TextDraw

https://forum.sa-mp.com/showthread.php?t=671806
TokicMajstor is offline   Reply With Quote
Old 14/01/2020, 02:36 PM   #10
KensPTV
Big Clucker
 
KensPTV's Avatar
 
Join Date: Oct 2019
Location: Vietnamese
Posts: 110
Reputation: 1
Default Re: HELP DIALOG

wait for me 20min
__________________
Kens.P TV @ Youtuber
Scripting @ Samp
Adminstrator @ Designer @ [KG:RP]
KensPTV is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLEO - Automatically select from DIALOG, when DIALOG is opened, and click the first button. AlaDyn172 Scripting Help 0 05/12/2019 01:43 AM
[DIALOG]How i Create A dialog Whent Player Login To Enter in Dialog The Password donhu789 Scripting Help 8 29/09/2013 07:15 AM
Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID Blackazur Scripting Help 1 30/04/2013 06:25 PM
[Dialog] Listing MySQL data inside a List Dialog vIBIENNYx Scripting Help 11 10/09/2012 11:19 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM


All times are GMT. The time now is 12:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.