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;
}
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);
}
if(moneys > GetPlayerMoney(playerid))
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == dialognameid1) {
return 1; return 1 here to stop calling this callback in other scripts.
}
if(dialogid == dialognameid2) {
return 1; return 1 here to stop calling this callback in other scripts.
}
return 0; // return 0 here to pass it on to other scripts
}
|
Returning 0 in this callback will pass the dialog to another script in case no matching code were found in your gamemode's callback. It is always called first in filterscripts so returning 1 there blocks other filterscripts from seeing it. |