[Include] AntiDesktopDialog v0.1
#1

~~~ AntiDesktopDialog v0.2 ~~~
Hi guys!
I present to you the ultimate include to prevent wrong processes of answered dialogs!

Storyline:
Quote:

You all know it, you're on your desktop and something ingame happens. You get a dialog-window!
So now, you want to re-enter the game. How do you do it? With return or ESC.

Damn!
There's been some important stuff to read and you didn't see it! What to do?

(More info about that "bug": Link.)

The Answer: Use this include!
It prevents incorrect dialogs being sent and shows up the dialog again!

Simple and clever!
All you have to do is to include it into your scripts (or a_samp.inc?).
pawn Код:
#include <AntiDesktopDialog>
Warning: If you've got a very big script, it could be that you're using very large dialogs (e.g. /stats). So you have to change the arraysize in line 49!
pawn Код:
new varstring[256];
Changelog:
[v0.2]:
  • Fixed an issue where dialogs for playerIDs did not hide after a relog/disconnect.
[v0.1]:
  • First Release
Here you go: Download.
Pastebin

Post in german forums

Greetz
Meta.

PS: Critics and comments are welcome
Some testing would be great, too. I tested it, but it still could be buggy because of recent changes.
Reply
#2

really nice
Reply
#3

wow awesome, now kalcor just have to put this in client
Reply
#4

useful but if i connect and go to desktop
switch back and got kicked by dialog
but yea ^^
Reply
#5

simple question: did you include it right?

@all: If you got an error because of "!NPC(playerid)", please redownload or change it to "!IsPlayerNPC(playerid)"
Reply
#6

1:
pawn Код:
CallLocalFunction("ADD_OnDialogResponse", "dddds", playerid, dialogid, response, listitem, inputtext);
will crash the script with empty inputtext. fix:
pawn Код:
if (inputtext[0] = 0) inputtext[0] = 1;
CallLocalFunction("ADD_OnDialogResponse", "dddds", playerid, dialogid, response, listitem, inputtext);
2:
in ShowPlayerDialogWin.............. you have forgotten a debug message:
pawn Код:
SendClientMessageToAll(0xFFFFFFFF, "ShowPlayerDialog");
BTW, it can be nice

Edit
Nah, I've found a bug..
pawn Код:
CallLocalFunction("ADD_OnDialogResponse", "dddds", playerid, dialogid, response, listitem, inputtext);
return 1;
If it returns 1, it won't pass the response to another callbacks. So I suggest doing this:
pawn Код:
return CallLocalFunction("ADD_OnDialogResponse", "dddds", playerid, dialogid, response, listitem, inputtext);
Reply
#7

thanks for your feedback. I'll change it.
Btw I had this debug message but if someone needs it, he/she could add it

EDIT: I remember inputtext is "#" by default, isn't it?
Anyway I'll fix it.
Reply
#8

Awesome work, it should be added directily in the client.
Reply
#9

Quote:
Originally Posted by Meta
Посмотреть сообщение
thanks for your feedback. I'll change it.
Btw I had this debug message but if someone needs it, he/she could add it

EDIT: I remember inputtext is "#" by default, isn't it?
Anyway I'll fix it.
No, it isn't.
Reply
#10

Thanks!
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)