SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 06/08/2011, 09:13 PM   #1
Kyle_Olsen
Big Clucker
 
Join Date: Sep 2010
Posts: 187
Reputation: 47
Default Server crashes because of dialogs

Hello, I am using dialogs for my phone script, and I am having sort of a problem.

I run this dialog here:

pawn Code:
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Phone", "Choose what you want to do:", "Call", "SMS");

Which should trigger this code:

pawn Code:
case 7:
        {
              if(response)
              {
                  format(string, sizeof(string), "* %s types in a number and brings their phone to their ear", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to call:", "Call", "Cancel");
              }else{
                  format(string, sizeof(string), "* %s types in a number on their cellphone", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to SMS:", "Proceed", "Cancel");
              }
        }

But instead, if I click any of the buttons, it crashes the server.

Does anyone know what might cause this?
__________________
Osiris Gaming
www.osiris-gaming.com
OS-RP: samp.osiris-gaming.com:7777
Kyle_Olsen is offline  
Old 06/08/2011, 09:15 PM   #2
0_o
Big Clucker
 
0_o's Avatar
 
Join Date: May 2011
Posts: 170
Reputation: 0
Default Re: Server crashes because of dialogs

Try This:

pawn Code:
case 7:
        {
                  format(string, sizeof(string), "* %s types in a number and brings their phone to their ear", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to call:", "Call", "Cancel");
              }else{
                  format(string, sizeof(string), "* %s types in a number on their cellphone", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to SMS:", "Proceed", "Cancel");
              }
        }
return 1;
}
__________________

Ip: 204.93.201.130:7777


0_o is offline  
Old 06/08/2011, 09:22 PM   #3
Kyle_Olsen
Big Clucker
 
Join Date: Sep 2010
Posts: 187
Reputation: 47
Default Re: Server crashes because of dialogs

That would return an error because there are one bracket too much and also I am using the if(response) to choose which action to do.
__________________
Osiris Gaming
www.osiris-gaming.com
OS-RP: samp.osiris-gaming.com:7777
Kyle_Olsen is offline  
Old 06/08/2011, 09:26 PM   #4
0_o
Big Clucker
 
0_o's Avatar
 
Join Date: May 2011
Posts: 170
Reputation: 0
Default Re: Server crashes because of dialogs

Why Are You Using Case Then?
Try this:
pawn Code:
if(dialogid == id)
{
if(response)
        {
                  format(string, sizeof(string), "* %s types in a number and brings their phone to their ear", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to call:", "Call", "Cancel");
              }else{
                  format(string, sizeof(string), "* %s types in a number on their cellphone", GetName(playerid));
                  NearByMessage(playerid, 12.0, PURPLE, string);
                  ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "Phone", "Type in the number you wish to SMS:", "Proceed", "Cancel");
              }
        }
return 1;
}
if Pawn Crashes Remove Or Add One More Bracket Before Return.
__________________

Ip: 204.93.201.130:7777


0_o is offline  
Old 06/08/2011, 09:29 PM   #5
Kyle_Olsen
Big Clucker
 
Join Date: Sep 2010
Posts: 187
Reputation: 47
Default Re: Server crashes because of dialogs

That will not fix my problem.
Cases haven't got anything to do with my problem, cases are just an easier version of checking what dialog ID it is.
__________________
Osiris Gaming
www.osiris-gaming.com
OS-RP: samp.osiris-gaming.com:7777
Kyle_Olsen is offline  
Old 06/08/2011, 09:33 PM   #6
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default Re: Server crashes because of dialogs

Debug your server and see where the code stop.
__________________
(RETIRED)
=WoR=Varth is offline  
Old 06/08/2011, 09:36 PM   #7
0_o
Big Clucker
 
0_o's Avatar
 
Join Date: May 2011
Posts: 170
Reputation: 0
Default Re: Server crashes because of dialogs

Your Problem Is Basicly
pawn Code:
}else{
Because It Happened To Me Many Times. That's Not Really Big Problem I Guess.
__________________

Ip: 204.93.201.130:7777


0_o is offline  
Old 06/08/2011, 09:42 PM   #8
Kyle_Olsen
Big Clucker
 
Join Date: Sep 2010
Posts: 187
Reputation: 47
Default Re: Server crashes because of dialogs

Nope, that was not the problem, I tried replacing the else with a new if, but the same thing happened.

Quote:
Originally Posted by varthshenon View Post
Debug your server and see where the code stop.
The server crashes when I click call or SMS, I can't get it closer than that...
__________________
Osiris Gaming
www.osiris-gaming.com
OS-RP: samp.osiris-gaming.com:7777
Kyle_Olsen is offline  
Old 06/08/2011, 09:43 PM   #9
0_o
Big Clucker
 
0_o's Avatar
 
Join Date: May 2011
Posts: 170
Reputation: 0
Default Re: Server crashes because of dialogs

Great. So Working Now?
__________________

Ip: 204.93.201.130:7777


0_o is offline  
Old 06/08/2011, 09:44 PM   #10
Kyle_Olsen
Big Clucker
 
Join Date: Sep 2010
Posts: 187
Reputation: 47
Default Re: Server crashes because of dialogs

No, when I get the same thing, of course it isn't working?
__________________
Osiris Gaming
www.osiris-gaming.com
OS-RP: samp.osiris-gaming.com:7777
Kyle_Olsen is offline  
 

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
Game crashes with dialogs leong124 Bug Reports 55 28/10/2016 06:07 AM
My game crashes cause of Dialogs.. Ehab1911 Help Archive 4 22/07/2011 01:01 PM
[Include] Callback Dialogs (Faster processing dialogs) clavador Includes 2 06/07/2011 10:59 AM
Server crashes when more than 1 person joins the server???? WillyP Server Support 0 05/07/2010 06:47 PM
Server crashes Yardieking Help Archive 11 18/04/2009 07:18 PM


All times are GMT. The time now is 09:34 AM.


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