SA-MP Forums Archive
(HELP) Dialog Esc, or Cancel closes conection with svr - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (HELP) Dialog Esc, or Cancel closes conection with svr (/showthread.php?tid=268947)



(HELP) Dialog Esc, or Cancel closes conection with svr - spaty2 - 14.07.2011

Hello, I have dialog what shows me, you can buy a Driving License Test and there is Ok or can be Cancel
If I click cancel server will close a conection, and i need that will only close dialog window.Is it possible?


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - spaty2 - 14.07.2011

I thought this is easy.


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - cessil - 14.07.2011

it sounds like your dialog ids are being messed up, here's how i do it so they don't get muddled up
I have a stock called ResetDialogs which resets a set of pvars such like this:

pawn Код:
ResetDialogs(playerid)
{
    SetPVarInt(playerid,"dialog1",-1); since no dialog created would be id -1
}
then when i want to show them a dialog I'll use
pawn Код:
new DID;
ShowPlayerDialog(playerid,DID,ect...
SetPVarInt(playerid,"dialog1",DID);
then when they respond to a dialog, after i have figured out which dialog it is I reset the dialogids with ResetDialogs(playerid)
pawn Код:
if(dialogid == GetPVarInt(playerid,"dialog1"))
    {
        ResetDialogs(playerid);
don't forget to also reset the dialogs when the player joins the server


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - spaty2 - 14.07.2011

I think it is because in my game, is registration Login, cancel or Register, Cancel and there if you do Cancel it will close conection too, maybe it is because this?


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - [MG]Dimi - 14.07.2011

omg i know. You have something like this
PHP код:
if(dialogid)
{
    if(!
response)
    {
        
Kick(playerid);
    }

under
PHP код:
public OnDialogResponse 
. If you have post here code. You have read that if you have only one dialog you can leave dialogid. Otherwise you must use dialogid == 0/1/2/3/4...


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - spaty2 - 14.07.2011

I dont have in script
PHP код:
public OnDialogResponse 



Re: (HELP) Dialog Esc, or Cancel closes conection with svr - [MG]Dimi - 14.07.2011

second callback from the end. You have it, trust me.


Re: (HELP) Dialog Esc, or Cancel closes conection with svr - spaty2 - 14.07.2011

I found that, thank you, man