Dialog problem
#5

Full code:

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == ActionChoice[3])
	{
		ShowPlayerDialog(playerid, 2211, DIALOG_STYLE_INPUT, "Give Cash", "Input the amount of cash to give.", "Select", "Back");
		HideActionTD(playerid);
		return 1;
	}
        return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 2211)
	{
		if(response)
		{
			new moneys = strval(inputtext);
		    //debug
			new string[40];
			format(string, 40, "%i", (0 - moneys));
			ERROR(playerid, string);
			//end of debug
   			if(moneys > GetPlayerMoney(playerid))
			{
   			 	GivePlayerMoney(playerid, (0 - moneys));
			}
			else return ERROR(playerid, "You don't have enough money");
		}
		else
		{
		    ShowActionTD(playerid);
		}
		return 1;
	}
	return 0;
}

stock ERROR(playerid,msg[])
{
	new error[128];
	format(error,128,"{FF0000}[ERROR]:{FFFFFF} %s",msg);
	return SendClientMessage(playerid,-1,error);
}
Bit suspicious on
Код:
if(moneys > GetPlayerMoney(playerid))
Should the operation be > or <?
Reply


Messages In This Thread
Dialog problem - by NealPeteros - 24.11.2017, 12:32
Re: Dialog problem - by Juvanii - 24.11.2017, 12:46
Re: Dialog problem - by NealPeteros - 24.11.2017, 12:47
Re: Dialog problem - by thefirestate - 24.11.2017, 13:19
Re: Dialog problem - by NealPeteros - 24.11.2017, 22:07
Re: Dialog problem - by RedFusion - 24.11.2017, 22:17
Re: Dialog problem - by NealPeteros - 24.11.2017, 22:23
Re: Dialog problem - by RedFusion - 24.11.2017, 22:33
Re: Dialog problem - by NealPeteros - 24.11.2017, 22:47

Forum Jump:


Users browsing this thread: 1 Guest(s)