SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/02/2020, 04:54 AM   #1
redtin06
Little Clucker
 
Join Date: Oct 2018
Location: maharlika
Posts: 44
Reputation: 0
Default DIALOG_STYLE_INPUT

no error but when im in game trying to choose item 5 and gonna put how many then nothing happens

Code:
                        if(listitem == 5)
			{
				ShowPlayerDialog(playerid, STOREMENU_SPRAYCAN, DIALOG_STYLE_INPUT, "Store menu", "How many would you like?", "Enter", "Cancel");
			}
Code:
        else if(dialogid == STOREMENU_SPRAYCAN)
	{
	    if(response)
		{
		    new spraycan = strval(inputtext), amount;
	    	amount = spraycan * 20;

	   		if(GetPlayerCash(playerid) >= amount)
			{
				if(PlayerInfo[playerid][pSpraycan] < spraycan) {
					PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					PlayerInfo[playerid][pSpraycan] += spraycan;
					format(string, sizeof(string), "%d Spraycans purchased.", spraycan);
					SendClientMessage(playerid, COLOR_WHITE, string);
					SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /colorcar or /paintcar while inside a vehicle.");
					GivePlayerCash(playerid, -amount);
					//BizInfo[idx][bMoney] +=20;
					BizInfo[PlayerInfo[playerid][InBusiness]][bMoney] += amount;
					BizInfo[PlayerInfo[playerid][InBusiness]][bSupplies] --;
				}
				else SendClientMessage(playerid, COLOR_GRAD4, "You can't hold any more of this item!");
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
			}
		}
	}
redtin06 is offline   Reply With Quote
Old 12/02/2020, 05:51 AM   #2
Robson04
Big Clucker
 
Robson04's Avatar
 
Join Date: Aug 2018
Location: Poland
Posts: 96
Reputation: 0
Default Re: DIALOG_STYLE_INPUT

#define STOREMENU_SPRAYCAN is valid? If you have two same ids dialogs can get errors.
Robson04 is offline   Reply With Quote
Old 12/02/2020, 05:53 AM   #3
redtin06
Little Clucker
 
Join Date: Oct 2018
Location: maharlika
Posts: 44
Reputation: 0
Default Re: DIALOG_STYLE_INPUT

Quote:
Originally Posted by Robson04 View Post
#define STOREMENU_SPRAYCAN is valid? If you have two same ids dialogs can get errors.
i have #define storemenu_spraycan


how
redtin06 is offline   Reply With Quote
Old 12/02/2020, 07:24 AM   #4
EAGLE
Little Clucker
 
Join Date: Nov 2019
Posts: 18
Reputation: 0
Default Re: DIALOG_STYLE_INPUT

you need to put a number for your dialog define

#define storemenu_spraycan (1)
#define dialog (2)
#define dialog (3)
...

or with enum

enum
{
dialog,
dialog_two,
dialog_three
};
EAGLE is offline   Reply With Quote
Old 12/02/2020, 08:52 AM   #5
redtin06
Little Clucker
 
Join Date: Oct 2018
Location: maharlika
Posts: 44
Reputation: 0
Default Re: DIALOG_STYLE_INPUT

Quote:
Originally Posted by EAGLE View Post
you need to put a number for your dialog define

#define storemenu_spraycan (1)
#define dialog (2)
#define dialog (3)
...

or with enum

enum
{
dialog,
dialog_two,
dialog_three
};
i have define for spraycan
#define STOREMENU_SPRAYCAN (27335)
redtin06 is offline   Reply With Quote
Old 12/02/2020, 09:10 AM   #6
SiaReyes
Gangsta
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 622
Reputation: 57
Default Re: DIALOG_STYLE_INPUT

You mean, the dialog is not even called?

Better try to debug!
SiaReyes is offline   Reply With Quote
Old 12/02/2020, 09:36 AM   #7
PPC23
Little Clucker
 
Join Date: Feb 2013
Posts: 26
Reputation: 9
Default Re: DIALOG_STYLE_INPUT

pawn Code:
else if(dialogid == STOREMENU_SPRAYCAN)
{
    if(!response) return 1;
    new spraycan = strval(inputtext), amount;
    amount = spraycan * 20;
    if(GetPlayerCash(playerid) < amount) return SendClientMessage(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
    if(PlayerInfo[playerid][pSpraycan] >= spraycan) return SendClientMessage(playerid, COLOR_GRAD4, "You can't hold any more of this item!");
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    PlayerInfo[playerid][pSpraycan] += spraycan;
    format(string, sizeof(string), "%d Spraycans purchased.", spraycan);
    SendClientMessage(playerid, COLOR_WHITE, string);
    SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /colorcar or /paintcar while inside a vehicle.");
    GivePlayerCash(playerid, -amount);
    //BizInfo[idx][bMoney] +=20;
    BizInfo[PlayerInfo[playerid][InBusiness]][bMoney] += amount;
    BizInfo[PlayerInfo[playerid][InBusiness]][bSupplies] --;
    return 1;
}
PPC23 is offline   Reply With Quote
Old 12/02/2020, 10:14 AM   #8
redtin06
Little Clucker
 
Join Date: Oct 2018
Location: maharlika
Posts: 44
Reputation: 0
Default Re: DIALOG_STYLE_INPUT

thanks to all who helped me, its all good now my format just wrong

its ShowPlayerDialogEx

still +rep
redtin06 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
DIALOG_STYLE_INPUT Beckett Scripting Help 10 23/09/2013 12:48 PM
[Ajuda] DIALOG_STYLE_INPUT MegaStyle157 Português/Portuguese 2 30/12/2012 06:43 PM
DIALOG_STYLE_INPUT Anak Scripting Help 4 30/09/2012 07:59 AM
Help with DIALOG_STYLE_INPUT CaTaLinU Scripting Help 2 28/08/2012 04:52 PM
DIALOG_STYLE_INPUT gedux123775 Help Archive 2 19/12/2009 03:02 PM


All times are GMT. The time now is 10:22 PM.


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