Dialog crashing server?
#1

Hello.
I just found an old map of mine while cleaning up my hard drive. Lead by curiosity I tried to launch it to check what features are there and such... How dissapointed I was when I noticed my map being crashed just after showing register dialog! What could be a reason of this?

PHP код:
public OnPlayerConnect(playerid)
{
    new 
str[128], secondstring[128], accname[128];
     
format(secondstringsizeof(secondstring), "Map By:"AUTHOR" || Vehicles %d|"VEHICLE_COUNT);
    
SendClientMessage(playeridCOLOR_WHITEsecondstring); printf("second string message");
    
format(accnamesizeof(accname), "FILES/ACCOUNTS/%s.ini"GetName(playerid)); printf("Accname formating");
     if(!
fexist(accname)) printf("Checking if there's a file for defined player");
     {
         
format(strsizeof(str), "{FFFFFF}Hello. {FBFF00}%s \n\n{FFFFFF}Register!"GetName(playerid)); printf("register dialog formating");
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Register"str"Register""Quit"); printf("Showed dialog");
    return 
1;

It looks like it crashes on bottom lines...
PHP код:
if(dialogid == DIALOG_REGISTER)
    {
        if(!
response) return Kick(playerid);
        if(
response)
        {
            if(
strlen(inputtext) == 0)
            {
                
format(stringsizeof(string), "{FFFFFF}Hello {FBFF00}%s \n\n{FFFFFF}Register"GetName(playerid));
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Register"string"Register""Quit");
                return 
0;
            } 
Reply
#2

You forget a } .

Add a } after
Код:
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", str, "Register", "Quit"); printf("Showed dialog");
And post all response for dialog.
Reply
#3

PHP код:
if(!fexist(accname))
            {
                
djCreateFile(accname);
                
djSetInt(accname,"Password",udb_hash(inputtext));
                
OnPlayerRegister(playerid);
                
ShowPlayerDialog(playeridDIALOG_SEXDIALOG_STYLE_LIST"Man or Woman?""Man\nWoman""Select""Cancel");
            }
        }
    } 
Reply
#4

It crashes directly after showing register dialog. I checked it with ExecutionLogger...
Reply
#5

bump
Reply
#6

BUMP!! <cry>
Reply
#7

Try this:
pawn Код:
public OnPlayerConnect(playerid)
{
    new str[128], secondstring[128], accname[128];

    format(secondstring, sizeof(secondstring), "Map By:"AUTHOR" || Vehicles %d|", VEHICLE_COUNT);
    SendClientMessage(playerid, COLOR_WHITE, secondstring);
    printf("second string message");

    format(accname, sizeof(accname), "FILES/ACCOUNTS/%s.ini", GetName(playerid));
    printf("Accname formating");

    if(!fexist(accname))
    {
        printf("Checking if there's a file for defined player");

        format(str, sizeof(str), "{FFFFFF}Hello. {FBFF00}%s \n\n{FFFFFF}Register!", GetName(playerid));
        printf("register dialog formating");
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", str, "Register", "Quit");
        printf("Showed dialog");
    }

    return 1;
}
Reply
#8

It didn't work. It again crashed on showin dialog -.-
Reply
#9

Make sure that are all the folders are existing.
Reply
#10

I did. Even if there's one missing it wouldn't just save and not crash the server because of dialog.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)