ShowPlayerDialog problem
#10

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
i had the problem too but i solved it with this
With what?

Here's the code of the command:
Код:
if(strcmp(cmd, "/sellcar", true) == 0) {
	GetField(2,playerid,"owner");
	if(strcmp(result[playerid],pname,true) == 0)
	{
		if(IsInBusiness(1,playerid))
		{
			 if(strcmp(Business[playerid][bowner],pname, true) == 0)
			{
				ShowPlayerDialog(playerid,2041,DIALOG_STYLE_INPUT,"Vehicle Ownership","To sell this vehicle,\nplease enter the amount of money you want to sell it for.","Ok","Cancel");
				return 1;
			}
		}

		ShowPlayerDialog(playerid,2099,DIALOG_STYLE_MSGBOX,"Vehicle Ownership","To sell a vehicle,\nyou need to be in a vehicle dealership that you own.","Ok","");
	}
	else
	{
		ShowPlayerDialog(playerid,2099,DIALOG_STYLE_MSGBOX,"Vehicle Ownership","This is not your vehicle.","Ok","");
	}
	return 1;
			
}
This part works perfectly, and the function GetField is mine and return the result in the variable "result" (works fine in all the rest of my script)

So when i use this script i do have the page asking me for the amount

here's the code with dialog id 2041, (dialog id 2099 does not exist and it's ok)
Код:
//car dealership
	if(dialogid == 2041)//receive money amount
	{
		if(!response)//if cancel, cancel
		{
			return 1;
	    	}
	    	if(strval(inputtext)<1000 || strval(inputtext)>10000000)
	    	{
	    		//not valid number
	    		ShowPlayerDialog(playerid,2041,DIALOG_STYLE_INPUT,"Vehicle Ownership","To sell this vehicle,\nplease enter a valid amount of money(1000-10000000)","Ok","Cancel");
	    	}
	    	//give confirm
	    	format(message,sizeof(message),"Vehicle informations.\n\n\tLicense plate: %i\n\tModel: %s\n\tPrice: %i\n\nAre you sure you want to sell this vehicle?",GetPlayerVehicleID(playerid)+1000,VehiclesName[GetVehicleModel(GetPlayerVehicleID(playerid))+400],strval(inputtext));

	    	ShowPlayerDialog(playerid,2042,DIALOG_STYLE_MSGBOX,"Vehicle Dealership",message,"Yes","Back");

	    	return 1;

	}
And finally i want to say that if i enter a bad number, the dialog saying to put it again works, but when i enter a valid number, it just do nothing

Thanks guys for your help...
Reply


Messages In This Thread
ShowPlayerDialog problem - by rt-2 - 28.09.2011, 04:11
Re: ShowPlayerDialog problem - by Cypress - 28.09.2011, 04:22
Re: ShowPlayerDialog problem - by Jack_Leslie - 28.09.2011, 04:50
Re: ShowPlayerDialog problem - by Dragony92 - 28.09.2011, 05:52
Re: ShowPlayerDialog problem - by [MWR]Blood - 28.09.2011, 06:02
Re: ShowPlayerDialog problem - by Tigerkiller - 28.09.2011, 07:42
Re: ShowPlayerDialog problem - by [MWR]Blood - 28.09.2011, 07:43
Re: ShowPlayerDialog problem - by Dragony92 - 28.09.2011, 07:44
Re: ShowPlayerDialog problem - by Tigerkiller - 28.09.2011, 07:48
Re: ShowPlayerDialog problem - by rt-2 - 28.09.2011, 22:49

Forum Jump:


Users browsing this thread: 4 Guest(s)