SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 28/05/2015, 03:58 PM   #51
iWhite
Big Clucker
 
Join Date: May 2012
Posts: 176
Reputation: 18
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)



When I enter vehicle, server shows me box of dialog background. Why? When I exit the vehicle, it disappears.
iWhite is offline   Reply With Quote
Old 28/05/2015, 04:07 PM   #52
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,772
Reputation: 854
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by iWhite View Post


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.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 28/05/2015, 07:38 PM   #53
DanLore
Big Clucker
 
DanLore's Avatar
 
Join Date: Jan 2013
Posts: 99
Reputation: 19
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

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.
__________________
LS-CL - Los Santos Cops and Robbers
94.23.45.38:7777
DanLore is offline   Reply With Quote
Old 28/05/2015, 07:50 PM   #54
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,844
Reputation: 1399
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by DanLore View Post
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.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/05/2015, 07:55 PM   #55
DanLore
Big Clucker
 
DanLore's Avatar
 
Join Date: Jan 2013
Posts: 99
Reputation: 19
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by Konstantinos View Post
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 Code:
return CallLocalFunction("Dialog_OnDialogResponse""iiiis"playeriddialogidresponselistiteminputtext); 
__________________
LS-CL - Los Santos Cops and Robbers
94.23.45.38:7777
DanLore is offline   Reply With Quote
Old 28/05/2015, 07:59 PM   #56
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,844
Reputation: 1399
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

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.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/05/2015, 08:27 PM   #57
iWhite
Big Clucker
 
Join Date: May 2012
Posts: 176
Reputation: 18
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by Gammix View Post
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?
iWhite is offline   Reply With Quote
Old 29/05/2015, 02:58 AM   #58
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,772
Reputation: 854
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by DanLore View Post
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 Code:
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 View Post
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 View Post
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.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 29/05/2015, 05:17 AM   #59
Unrea1
Gangsta
 
Unrea1's Avatar
 
Join Date: Oct 2013
Location: Venezuela
Posts: 792
Reputation: 126
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

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 (c) 1997-2006, ITB CompuPhase


2 Warnings.
Unrea1 is offline   Reply With Quote
Old 29/05/2015, 05:29 AM   #60
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,772
Reputation: 854
Default Re: Dialogs Include (new dialog functions and DIALOG_STYLE_PREVMODEL)

Quote:
Originally Posted by LatinZ View Post
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 (c) 1997-2006, ITB CompuPhase


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

You may show me your code.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Items spawner dialogs (zcmd & dialogs include) Q_Lite Filterscripts 17 16/10/2016 12:09 PM
[FilterScript] [FS]Fighting Styles,5 most usable styles Like in SP By Don_(GH) HAYTXA Filterscripts 10 28/03/2013 07:39 AM
Making an OnFilterScriptInit in an include without adding anything in the .pwn exepct the #include r3k1lLz_ Help Archive 6 06/01/2011 07:49 AM
[FilterScript] [FS]Trans World Airlines v0.2 [TWA] - Bug Fixed - Adding Dialogs Soon. Toni Filterscripts 16 13/06/2010 03:57 PM
[FilterScript] [FS] Fighting Styles (0.3a) - |Save styles in Dini| MoBiL[e] Filterscripts 23 24/04/2010 12:12 PM


All times are GMT. The time now is 03:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.