SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/08/2017, 01:12 AM   #11
HoussemGaming
Banned
 
Join Date: Jun 2017
Location: France
Posts: 190
Reputation: 10
Default Re: How to keep the dialog after buying weap.

Just show the dialog again..
HoussemGaming is offline   Reply With Quote
Old 26/08/2017, 02:05 AM   #12
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: How to keep the dialog after buying weap.

Quote:
Originally Posted by HoussemGaming View Post
Just show the dialog again..
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == Dialog_Shop)
	{
	    if(!response) return SendClientMessage(playerid,COLOR_YELLOW,"You closed the shop menu!");
		switch(listitem)
		{
			case 0:
			{
				ShowPlayerDialog(playerid,Dialog_Weapons,5,"Weapons","Weapon\tPrice\tAmmo\nDeagle\t$1000\t90\nPump Shotgun\t$1800\t150\nSawnoff\t$2500\t85\nM4\t$3500\t500\nAK-47\t$3000\t500\nMp5\t$2800\t500\nTec-9\t$2400\t500\nSniper\t$4800\t40","Buy","Back");
				PlayerPlaySound(playerid,5201,0,0,0);
			} // weapons
			case 1:
			{
				ShowPlayerDialog(playerid,Dialog_HA,5,"Health and Armor","Name\tPrice\nHealth\t$10000\nArmor\t$15000","Buy","Back");
				PlayerPlaySound(playerid,5201,0,0,0);
			} //vehicles
			case 2:
			{
			    ShowPlayerDialog(playerid,Dialog_Weather,5,"Weather","Name\tPrice\nSunny\t$200\nStormy\t$200\nCloudy and Foggy\t$200\nSandstorm\t$200\nFoggy\t$200\nDark\t$200","Buy","Back");
                PlayerPlaySound(playerid,5201,0,0,0);
			} //foods
			case 3:
			{
			    ShowPlayerDialog(playerid,Dialog_Time,2,"Time","Day\nNight","Select","Back");
                PlayerPlaySound(playerid,5201,0,0,0);
			} //Accessories
		}
	}
	if(dialogid == Dialog_Weapons)
	{
		if(!response) return ShowPlayerDialog(playerid,Dialog_Shop,DIALOG_STYLE_LIST,"WoF Shop Menu:","Weapons\nHealth and Armor\nWeather\nTime","Select","Quit");
		switch(listitem)
		{
			case 0:
			{
				if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
				GivePlayerMoney(playerid,-1000);
				GivePlayerWeapon(playerid,24,90);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"Deagle "COL_WHITE"For "COL_RED"$1000");
			}
			case 1:
			{
                if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-1800);
				GivePlayerWeapon(playerid,25,150);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"Shotgun "COL_WHITE"For "COL_RED"$1800");
			}
			case 2:
			{
                if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-2500);
				GivePlayerWeapon(playerid,26,85);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"SawnOff Shotgun "COL_WHITE"For "COL_RED"$2500");
			}
			case 3:
			{
                if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-3500);
				GivePlayerWeapon(playerid,31,500);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"M4 "COL_WHITE"For "COL_RED"$3500");
			}
			case 4:
			{
                if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-3000);
				GivePlayerWeapon(playerid,30,500);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"AK-47 "COL_WHITE"For "COL_RED"$3000");
			}
			case 5:
			{
                if(GetPlayerMoney(playerid) < 2800) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-2800);
				GivePlayerWeapon(playerid,29,500);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"Mp5 "COL_WHITE"For "COL_RED"$2800");
			}
			case 6:
			{
                if(GetPlayerMoney(playerid) < 2400) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-2400);
				GivePlayerWeapon(playerid,32,500);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"Tec-9 "COL_WHITE"For "COL_RED"$2400");
			}
			case 7:
			{
                if(GetPlayerMoney(playerid) < 4800) return SendClientMessage(playerid,COLOR_RED,"You Dont Have That Much Money");
                GivePlayerMoney(playerid,-4800);
				GivePlayerWeapon(playerid,34,40);
				PlayerPlaySound(playerid,1052,0,0,0);
				SendClientMessage(playerid,COLOR_WHITE,"You Have Bought A "COL_RED"Sniper "COL_WHITE"For "COL_RED"$4800");
			}
		}
	}
Since that shop menu didn't gave me the best, i decided to try another and here is the code for dialog_weapons. Even this code didn't show me the dialog after double clicking/buying the weapon.
Rohit12 is offline   Reply With Quote
Old 26/08/2017, 02:08 AM   #13
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: Respuesta: Re: Respuesta: Re: How to keep the dialog after buying weap.

Quote:
Originally Posted by Miguelch1312 View Post
Why you don't try removing the "&& response" ?
I tried it , but didn't work so I changed to another shop dialog. And still this problem exist. Please check my post above.
Rohit12 is offline   Reply With Quote
Old 26/08/2017, 06:18 PM   #14
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: How to keep the dialog after buying weap.

Someone please ?
Rohit12 is offline   Reply With Quote
Old 26/08/2017, 07:07 PM   #15
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 326
Reputation: 30
Default Re: How to keep the dialog after buying weap.

A dialog is CLOSED whenever a button is 'pressed' (with mouseclick / ENTER + ESC)
However you could do this with some textdraw and also you will have the ability to give it a cool background
10MIN is offline   Reply With Quote
Old 26/08/2017, 10:39 PM   #16
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: How to keep the dialog after buying weap.

Quote:
Originally Posted by 10MIN View Post
A dialog is CLOSED whenever a button is 'pressed' (with mouseclick / ENTER + ESC)
However you could do this with some textdraw and also you will have the ability to give it a cool background
No no no, im asking because i've seen it in a server. I also have the video clip of the dialog remaining after mouseclick.

It is imp because my weap dialog is not used as a cmd, it is used as a weapon shop in some places that can be picked up(a $ pickup) So once i buy a weapon by mouseclick or enter , it closes the dialog and the shop pickup is gone, so it is impossible to buy anything again from it unless we wait for another 30 secs for the pickup to come again.

So we can only buy several things from the shop by picking up the pickup and once something is bought, it should remain as it is so we can either go back or purchase smth else.

Hope you understand
Rohit12 is offline   Reply With Quote
Old 28/08/2017, 01:28 AM   #17
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: How to keep the dialog after buying weap.

Help guys😞
Rohit12 is offline   Reply With Quote
Old 28/08/2017, 12:48 PM   #18
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 326
Reputation: 30
Default Re: How to keep the dialog after buying weap.

Read this: Pickup Types and change to type 1.
10MIN is offline   Reply With Quote
Old 28/08/2017, 01:28 PM   #19
Rohit12
Big Clucker
 
Join Date: Jul 2017
Posts: 84
Reputation: 1
Default Re: How to keep the dialog after buying weap.

This makes it unable to select my desired item because it keeps on popping the dialog before i choose something.

So this aint the best idea!

Waiting for the right solution
Rohit12 is offline   Reply With Quote
Old 28/08/2017, 01:40 PM   #20
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 326
Reputation: 30
Default Re: How to keep the dialog after buying weap.

Add something like:
Code:
new bool:readyforweap[MAX_PLAYERS];
//OnPlayerConnect:

readyforweap[playerid] = true;

//And before you show the dialog:
if(readyforweap[playerid])
{
     readyforweap[playerid] = false;
     ShowPlayerDialog(blablabla);
}
//And after he selected the weap:
SetTimerEx();
//And on the function called by SetTimerEx
readyforweap = true;
10MIN 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
buying in dialog problem Swisher Scripting Help 7 13/02/2014 02:41 PM
[FilterScript] Weapon Buying Dialog San1 Filterscripts 8 23/02/2013 10:17 AM
[FilterScript] Simple Buying Weapon Dialog Deviant96 Filterscripts 1 07/07/2012 07:00 AM
[Erro]weap Mteck Português/Portuguese 6 09/11/2011 10:04 PM
dialog shop buying even when u decline, ~Dangun! Help Archive 1 02/02/2010 05:06 PM


All times are GMT. The time now is 07:02 PM.


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