Script stops out of nowhere
#1

Hello,

Never had any issues with this so I have no idea what causes this,
When I connect to my server it runs everything that it should. It goes through a callback that would cause this to be triggered:

pawn Код:
stock SPD(playerid, dialogid) // a shortened custom function for ShowPlayerDialog; you don't have to handle all of the ShowPlayerDialog lines, just know the playerid and the dialogid you want to show
{
    print("CP 3");
    new string[500];
    print("CP 4");
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            print("CP 5");
            format(string, sizeof(string), "{FFFFFF}Welcome to {0086EF}Ultimate Sumo Server\n\n{FFFFFF}Username:  {0086EF}%s\n\n{FFFFFF}Please enter your password below", GetName(playerid));
            ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""#COL_EMB_WHITE"Account Registration", string, "Register", "Cancel");
            print("CP 6");
        }
        case DIALOG_AUTHENTICATION:
        {
            format(string, sizeof(string), "{FFFFFF}Welcome back to {0086EF}Ultimate Sumo Server\n\n{FFFFFF}Username:  {0086EF}%s\n\n{FFFFFF}Please enter your password below", GetName(playerid));
            ShowPlayerDialog(playerid, DIALOG_AUTHENTICATION, DIALOG_STYLE_PASSWORD, ""#COL_EMB_WHITE"Account Authentication", string, "Login", "Cancel");
        }
        case DIALOG_ADMINCODE:
        {
            format(string, sizeof(string), "{FFFFFF}Please enter your admin code below.");
            ShowPlayerDialog(playerid, DIALOG_ADMINCODE, DIALOG_STYLE_PASSWORD, ""#COL_EMB_WHITE"Admin Identification", string, "Login", "Cancel");
        }
        case DIALOG_ADMINCODE2:
        {
            format(string, sizeof(string), "{FFFFFF}Please enter your admin code below.\n\n{FF0000}You need to enter a code.");
            ShowPlayerDialog(playerid, DIALOG_ADMINCODE, DIALOG_STYLE_PASSWORD, ""#COL_EMB_WHITE"Admin Identification", string, "Login", "Cancel");
        }
        case DIALOG_ADMINCODE3:
        {
            format(string, sizeof(string), "{FFFFFF}Please enter your admin code below.\n\n{FF0000}Wrong Code.");
            ShowPlayerDialog(playerid, DIALOG_ADMINCODE, DIALOG_STYLE_PASSWORD, ""#COL_EMB_WHITE"Admin Identification", string, "Login", "Cancel");
        }
        case DIALOG_CHANGEPASSWORD:
        {
            format(string, sizeof(string), "{FFFFFF}Please enter your new password.");
            ShowPlayerDialog(playerid, DIALOG_CHANGEPASSWORD, DIALOG_STYLE_INPUT, ""#COL_EMB_WHITE"Change Password", string, "Change", "Cancel");
        }
    }
    return -1;
}
The register one, but it doesn't show up.
With debugging it showed that it stopped at number #4..

Please help me out
Reply
#2

Код:
[23:46:59] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[23:46:59] [debug]  Stack pointer (STK) is 0x65074, heap pointer (HEA) is 0x65044
[23:46:59] [debug] AMX backtrace:
[23:46:59] [debug] #0 00056430 in SPD (playerid=0, dialogid=1337) at X:\Documents\GTA SA Scripts\Sumo\Script\gamemodes\Sumo.pwn:7060
[23:46:59] [debug] #1 0001c204 in LoadPlayerData (playerid=0) at X:\Documents\GTA SA Scripts\Sumo\Script\gamemodes\Sumo.pwn:1554
[23:46:59] [debug] #2 0001ae7c in LoadBans (playerid=0) at X:\Documents\GTA SA Scripts\Sumo\Script\gamemodes\Sumo.pwn:1497
[23:46:59] [debug] #3 0001e750 in public Streamer_OnPlayerConnect (playerid=0) at X:\Documents\GTA SA Scripts\Sumo\Script\gamemodes\Sumo.pwn:1732
[23:46:59] [debug] #4 native CallLocalFunction () [00472ad0] from samp-server.exe
[23:46:59] [debug] #5 0000e014 in public S@@_OnPlayerConnect (playerid=0) at X:\Programs\Pawno\include\streamer.inc:342
[23:46:59] [debug] #6 00006c54 in public Itter_OnPlayerConnect (playerid=0) at X:\Programs\Pawno\include\YSI\y_hooks/impl.inc:618
[23:46:59] [debug] #7 00001998 in public OnPlayerConnect (playerid=0) at X:\Programs\Pawno\include\YSI\y_iterate.inc:646
Reply
#3

Firstly you don't need 500 cells big string.
And it seems you're running out of stack space.
Try not to use so large strings.

And from the logs given, I can't really know without seeing the code.
Reply
#4

I have used this system in 5 of my SAMP scirpt, even in one that is still working perfectly fine, In this script it started giving these bugs when I changed the mysql type from BlueG to Strickenkid but I dont think that has anything to do with it as the stock does not use MYSQL at all.. I might rescript it all unless someone want to help me over teamviewer.

I've always been bad at debugging :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)