SA-MP Forums Archive
[Include] Dialogs include - Adding new styles to SAMP GUI - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Dialogs include - Adding new styles to SAMP GUI (/showthread.php?tid=570213)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Excips - 20.05.2015

This is fucking awesome.

When will the model descriptions version come out?
I want to use it for making prev model dialogs based team selection


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Neufox - 20.05.2015

Very epic.

Is this faster than mSelection? And please release the description version asap so that i can create my spawn dialogs!


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Gammix - 20.05.2015

Description label version out! Screen:


Download from the thread.

NOTE: You can still use non-desc. version from dialogs2.inc! Desc. version dialog have a custom function: ShowPlayerPrevModelDialog.

If you want to stick with R4, theres no problem because there is no new code update.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Excel™ - 20.05.2015

Finally, thanks for dialogs2.Inc.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Q_Lite - 24.05.2015

Please add a feature by which we can set each listitem model's rotation and zoom.

Like: SetupPrevModelDialogListitem(dialogid, listitem, Float, Float:y, Float:z, Float:zoom);


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - iWhite - 28.05.2015

Good job!

But i have an error from CrashDetect plugin, when I'm using your include, while using default Dialog(MSGBOX):

Quote:

[17:32:10] [debug] Server crashed while executing new.amx
[17:32:10] [debug] AMX backtrace:
[17:32:10] [debug] #0 native CallLocalFunction () from samp-server.exe
[17:32:10] [debug] #1 0001edf4 in public OnDialogResponse (playerid=1, dialogid=327, response=1, listitem=-1, inputtext[]=@00993e3c "") at C:\Users\Kompiuteris\Desktop\GRP4\pawno\include\Di alogs.inc:632
[17:32:10] [debug] Native backtrace:
[17:32:10] [debug] #0 004743dc in ?? () from samp-server.exe
[17:32:10] [debug] #1 004010b6 in ?? () from samp-server.exe
[17:32:10] [debug] #2 5f8162ca in ?? () from plugins\crashdetect.dll
[17:32:10] [debug] #3 5f818b28 in ?? () from plugins\crashdetect.dll
[17:32:10] [debug] #4 5f8109c7 in ?? () from plugins\crashdetect.dll
[17:32:10] [debug] #5 5f81631a in ?? () from plugins\crashdetect.dll
[17:32:10] [debug] #6 5f7351a7 in ?? () from plugins\streamer.dll
[17:32:10] [debug] #7 0046eae1 in ?? () from samp-server.exe
[17:32:10] [debug] #8 004528f0 in ?? () from samp-server.exe
[17:32:10] [debug] #9 0049d629 in ?? () from samp-server.exe
[17:32:10] [debug] #10 004a8a4e in ?? () from samp-server.exe

Could you fix this?


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Kapersky™ - 28.05.2015

Man, it's awesome. Love it. Keep going dude! Really awesome.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Gammix - 28.05.2015

I just used ALS hook method 7 and those errors were fixed for me.

Update | R5 - 28th May, 2015Please download the latest R5 version from the thread.

This update has been done in both dialogs.inc and dialogs2.inc.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - iWhite - 28.05.2015

Quote:
Originally Posted by Gammix
Посмотреть сообщение
I just used ALS hook method 7 and those errors were fixed for me.

Update | R5 - 28th May, 2015
  • Fixed MSGBOX errors or crash
  • Updated to ALS hook method 7
Please download the latest R5 version from the thread.

This update has been done in both dialogs.inc and dialogs2.inc.
That was fast! I will report if I will see any errors


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - iWhite - 28.05.2015



When I enter vehicle, server shows me box of dialog background. Why? When I exit the vehicle, it disappears.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Gammix - 28.05.2015

Quote:
Originally Posted by iWhite
Посмотреть сообщение


When I enter vehicle, server shows me box of dialog background. Why? When I exit the vehicle, it disappears.
Thats not a problem related to the include i think. Maybe a problem related to your gamemode?

Just make sure you define FILTERSCRIPT if using in a filterscript.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - DanLore - 28.05.2015

Hi,

Great include but I have found a bug that caused my server to crash. The bug is on line 758 (or at-least this is what crashdetect reported), and occurs when either the listitem or inputttext is not used, listitem was reported to be -1 and inputtext was reported to be @01453144 "".

[19:41:16] [debug] #1 0000745c in public OnDialogResponse (playerid=0, dialogid=123, response=1, listitem=-1, inputtext[]=@01453144 "") at [Removed]\pawno\include\gamemode\dialogs2.inc:758

Other than that, works fine. I've fixed this issue temporarily on my own server, if this is an include issue then might crash other servers too.

Occurs if you use a DIALOG_STYLE_MSGBOX dialog.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Konstantinos - 28.05.2015

Quote:
Originally Posted by DanLore
Посмотреть сообщение
Hi,

Great include but I have found a bug that caused my server to crash. The bug is on line 758 (or at-least this is what crashdetect reported), and occurs when either the listitem or inputttext is not used, listitem was reported to be -1 and inputtext was reported to be @01453144 "".

[19:41:16] [debug] #1 0000745c in public OnDialogResponse (playerid=0, dialogid=123, response=1, listitem=-1, inputtext[]=@01453144 "") at [Removed]\pawno\include\gamemode\dialogs2.inc:758

Other than that, works fine. I've fixed this issue temporarily on my own server, if this is an include issue then might crash other servers too.

Occurs if you use a DIALOG_STYLE_MSGBOX dialog.
The crash might not be related to this include at all as every include with hooked callbacks are shown in crashdetect's results. Also if you notice, you'll see #1 which is the callback but what's #0? You need to know that otherwise you're not going to find what exactly caused it very easily.

Also since you temporary fixed it, a solution would be good for everybody else (in case it's caused by the include).

@Gammix: Very good work. Believe it or not, I've never used those preview models stuff and I'm kind of bored to do it anytime soon so this include comes in handy.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - DanLore - 28.05.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The crash might not be related to this include at all as every include with hooked callbacks are shown in crashdetect's results. Also if you notice, you'll see #1 which is the callback but what's #0? You need to know that otherwise you're not going to find what exactly caused it very easily.

Also since you temporary fixed it, a solution would be good for everybody else (in case it's caused by the include).

@Gammix: Very good work. Believe it or not, I've never used those preview models stuff and I'm kind of bored to do it anytime soon so this include comes in handy.
Sure thank you for bringing this up.

[19:41:16] [debug] #0 native CallLocalFunction () from samp-server.exe

The only thing I did to fix it was make sure that it's not possible for listitem to be -1 and for the string length of inputtext to be less than 1 in the following code. I did this for both as I'm not sure whether a -1 would cause a server crash with a dialog response.

PHP код:
return CallLocalFunction("Dialog_OnDialogResponse""iiiis"playeriddialogidresponselistiteminputtext); 



Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Konstantinos - 28.05.2015

Yeah, it's a known bug that CallLocalFunction crash the server if the string passed as argument is NULL/empty. ZCMD is a good example of preventing this by passing "\1" instead.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - iWhite - 28.05.2015

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Thats not a problem related to the include i think. Maybe a problem related to your gamemode?

Just make sure you define FILTERSCRIPT if using in a filterscript.
Script in my gamemode looks good. Before your include everything worked fine. Maybe when you create static textdraws they get new IDs from 0 again? So when I'm showing my speedometer textdraw, server shows 2 textdraws - speedometer's and dialog's, because they have the same ID?


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Gammix - 29.05.2015

Quote:
Originally Posted by DanLore
Посмотреть сообщение
Sure thank you for bringing this up.

[19:41:16] [debug] #0 native CallLocalFunction () from samp-server.exe

The only thing I did to fix it was make sure that it's not possible for listitem to be -1 and for the string length of inputtext to be less than 1 in the following code. I did this for both as I'm not sure whether a -1 would cause a server crash with a dialog response.

PHP код:
return CallLocalFunction("Dialog_OnDialogResponse""iiiis"playeriddialogidresponselistiteminputtext); 
Someone already reported that and if you haven't seen it before your post, i have released R5 version, which will probably fix this.

There is no way those values can be negative with this include, my include only adds a new dailog style (DIALOG_STYLE_PREVMODEL), it does not modifies the other styles nor handles them.

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Yeah, it's a known bug that CallLocalFunction crash the server if the string passed as argument is NULL/empty. ZCMD is a good example of preventing this by passing "\1" instead.
Yes your are right, but R5 version uses hooking method 7 and which will fix this issue as well.

Quote:
Originally Posted by iWhite
Посмотреть сообщение
Script in my gamemode looks good. Before your include everything worked fine. Maybe when you create static textdraws they get new IDs from 0 again? So when I'm showing my speedometer textdraw, server shows 2 textdraws - speedometer's and dialog's, because they have the same ID?
Can you show your code please?
Also, may i know which version are you using (dialogs or dialogs2)?

And i checked the hooking and all were done correctly.

Updated R5
- Added an additional check before calling OnDialogResponse for Prev Model dialogs. This may prevent crash.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Unrea1 - 29.05.2015

C:\Documents and Settings\Administrador\Escritorio\World of pawn\LEP Mysql\pawno\include\dialogs.inc(605) : warning 213: tag mismatch
C:\Documents and Settings\Administrador\Escritorio\World of pawn\LEP Mysql\pawno\include\dialogs.inc(652) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Gammix - 29.05.2015

Quote:
Originally Posted by LatinZ
Посмотреть сообщение
C:\Documents and Settings\Administrador\Escritorio\World of pawn\LEP Mysql\pawno\include\dialogs.inc(605) : warning 213: tag mismatch
C:\Documents and Settings\Administrador\Escritorio\World of pawn\LEP Mysql\pawno\include\dialogs.inc(652) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
I just compiled it once again and no warnings or errors.

You may show me your code.


Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL) - Unrea1 - 29.05.2015

Lines of problem in the include:

return Dialog_OnPlayerClickTextDraw(playerid, _:clickedid);

return Dialog_OnPlayerClickPlayerTD(playerid, _layertextid);