07.07.2011, 16:27
Hi.
Do you know why this code is executing twice?
if I use it:
That will print two times the number 1, but I only press the button once.
The ShowPlayerDialog function is as always:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"We lcome","Input something","Hit it","Cancel");
Do you know why this code is executing twice?
pawn Код:
#define Dialog(%1) forward DialogResponse_%1(playerid,response,listitem,inputtext[]); \
public DialogResponse_%1(playerid,response,listitem,inputtext[])
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new DialogToCall[24];
if(dialogid >= 0)
format(DialogToCall,24,"DialogResponse_%d",dialogid);
if(isnull(inputtext))format(inputtext,2,"\1");
if(funcidx(DialogToCall) != -1)
return CallLocalFunction(DialogToCall,"iiis",playerid,response,listitem,inputtext);
return 0;
}
pawn Код:
Dialog(1)
{
if(response)
{
if(IsNumeric(inputtext))
{
new deposit = strval(inputtext);
new asd[10];
format(asd,sizeof(asd),"%i",deposit);
SendClientMessage(playerid,COLOR_YELLOW,asd);
}
return 1;
}
The ShowPlayerDialog function is as always:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"We lcome","Input something","Hit it","Cancel");