Stack/heap collision (insufficient stack size)
#1

Problem:
Код:
[17:14:41] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[17:14:41] [debug]  Stack pointer (STK) is 0x48AEC, heap pointer (HEA) is 0x48B84
[17:14:41] [debug] AMX backtrace:
[17:14:41] [debug] #0 000270f8 in public OnDialogResponse (0, 32100, 1, 0, 297764) from g_casinogames.amx
OnDialogResponse code
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_CGAMESADMINMENU)
    {
        if(
response) {
            switch(
listitem)
            {
                case 
0:
                {
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSELECTPOKER);
                }
                case 
1:
                {
                }
                case 
2:
                {
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESCREDITS);
                }
            }
        }
    }
    if(
dialogid == DIALOG_CGAMESSELECTPOKER)
    {
        if(
response) {
            
SetPVarInt(playerid"tmpEditPokerTableID"listitem+1);
            
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPOKER);
        } else {
            
ShowCasinoGamesMenu(playeridDIALOG_CGAMESADMINMENU);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPOKER)
    {
        if(
response) {
            new 
tableid GetPVarInt(playerid"tmpEditPokerTableID")-1;
        
            if(
PokerTable[tableid][pkrPlaced] == 0) {
                switch(
listitem)
                {
                    case 
0// Place Poker Table
                    
{
                        new 
szString[128];
                        
format(szStringsizeof(szString), "Press '{3399FF}~k~~PED_SPRINT~{FFFFFF}' to place poker table.");
                        
SendClientMessage(playeridCOLOR_WHITEszString);
                        
                        
SetPVarInt(playerid"tmpPlacePokerTable"1);
                    }
                }
            } else {
                switch(
listitem)
                {
                    case 
0// Edit Poker Table
                    
{
                        
SetPVarFloat(playerid"tmpPkrX"PokerTable[tableid][pkrX]);
                        
SetPVarFloat(playerid"tmpPkrY"PokerTable[tableid][pkrY]);
                        
SetPVarFloat(playerid"tmpPkrZ"PokerTable[tableid][pkrZ]);
                        
SetPVarFloat(playerid"tmpPkrRX"PokerTable[tableid][pkrRX]);
                        
SetPVarFloat(playerid"tmpPkrRY"PokerTable[tableid][pkrRY]);
                        
SetPVarFloat(playerid"tmpPkrRZ"PokerTable[tableid][pkrRZ]);
                    
                        
EditObject(playeridPokerTable[tableid][pkrObjectID]);
            
                        new 
szString[128];
                        
format(szStringsizeof(szString), "You have selected Poker Table %d, You may now customize it's position/rotation."tableid);
                        
SendClientMessage(playeridCOLOR_WHITEszString);
                    }
                    case 
1// Destroy Poker Table
                    
{
                        
DestroyPokerTable(tableid);
                        
                        new 
szString[64];
                        
format(szStringsizeof(szString), "You have deleted Poker Table %d."tableid);
                        
SendClientMessage(playeridCOLOR_WHITEszString);
                        
                        
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSELECTPOKER);
                    }
                }
            }
        } else {
            
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSELECTPOKER);
        }
    }
    if(
dialogid == DIALOG_CGAMESCREDITS)
    {
        
ShowCasinoGamesMenu(playeridDIALOG_CGAMESADMINMENU);
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME)
    {
        if(
response) {
            switch(
listitem)
            {
                case 
0// Buy-In Max
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME2);
                }
                case 
1// Buy-In Min
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME3);
                }
                case 
2// Blind
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME4);
                }
                case 
3// Limit
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME5);
                }
                case 
4// Password
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME6);
                }
                case 
5// Round Delay
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME7);
                }
                case 
6// Start Game
                
{
                    
ShowCasinoGamesMenu(playeridDIALOG_CGAMESBUYINPOKER);
                }
            }
        } else {
            
LeavePokerTable(playerid);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME2)
    {
        if(
response) {
            if(
strval(inputtext) < || strval(inputtext) > 1000000000) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME2);
            }
            
            if(
strval(inputtext) <= PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMin]) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME2);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMax] = strval(inputtext);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME3)
    {
        if(
response) {
            if(
strval(inputtext) < || strval(inputtext) > 1000000000) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME3);
            }
            
            if(
strval(inputtext) >= PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMax]) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME3);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMin] = strval(inputtext);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME4)
    {
        if(
response) {
            if(
strval(inputtext) < || strval(inputtext) > 1000000000) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME4);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBlind] = strval(inputtext);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME5)
    {
        if(
response) {
            if(
strval(inputtext) < || strval(inputtext) > 6) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME5);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrLimit] = strval(inputtext);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME6)
    {
        if(
response) {
            new 
tableid GetPVarInt(playerid"pkrTableID")-1;
            
strmid(PokerTable[tableid][pkrPass], inputtext0strlen(inputtext), 32);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESSETUPPGAME7)
    {
        if(
response) {
            if(
strval(inputtext) < 15 || strval(inputtext) > 120) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME7);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrSetDelay] = strval(inputtext);
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        } else {
            return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESSETUPPGAME);
        }
    }
    if(
dialogid == DIALOG_CGAMESBUYINPOKER)
    {
        if(
response) {
            if(
strval(inputtext) < PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMin] || strval(inputtext) > PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrBuyInMax] || strval(inputtext) > GetPVarInt(playerid"cgChips")) {
                return 
ShowCasinoGamesMenu(playeridDIALOG_CGAMESBUYINPOKER);
            }
            
            
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrActivePlayers]++;
            
SetPVarInt(playerid"pkrChips"GetPVarInt(playerid"pkrChips")+strval(inputtext));
            
SetPVarInt(playerid"cgChips"GetPVarInt(playerid"cgChips")-strval(inputtext));
            
            
            if(
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrActive] == && PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrRound] == && PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrDelay] >= 6) {
                
SetPVarInt(playerid"pkrStatus"1);
            }
            else if(
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrActive] < 3) {
                
SetPVarInt(playerid"pkrStatus"1);
            }
            
            if(
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrActive] == && GetPVarInt(playerid"pkrRoomLeader")) {
                
PokerTable[GetPVarInt(playerid"pkrTableID")-1][pkrActive] = 2;
                
SelectTextDraw(playeridCOLOR_GOLD);
            }
        } else {
            return 
LeavePokerTable(playerid);
        }
    }
    if(
dialogid == DIALOG_CGAMESCALLPOKER)
    {
        if(
response) {
            new 
tableid GetPVarInt(playerid"pkrTableID")-1;
            
            new 
actualBet PokerTable[tableid][pkrActiveBet]-GetPVarInt(playerid"pkrCurrentBet");
            
            if(
actualBet GetPVarInt(playerid"pkrChips")) {
                
PokerTable[tableid][pkrPot] += GetPVarInt(playerid"pkrChips");
                
SetPVarInt(playerid"pkrChips"0);
                
SetPVarInt(playerid"pkrCurrentBet"PokerTable[tableid][pkrActiveBet]);
            } else {
                
PokerTable[tableid][pkrPot] += actualBet;
                
SetPVarInt(playerid"pkrChips"GetPVarInt(playerid"pkrChips")-actualBet);
                
SetPVarInt(playerid"pkrCurrentBet"PokerTable[tableid][pkrActiveBet]);
            }
            
SetPVarString(playerid"pkrStatusString""Call");
            
PokerRotateActivePlayer(tableid);
            
            
ApplyAnimation(playerid"CASINO""cards_raise"4.1011111);
        }
        
        
DeletePVar(playerid"pkrActionChoice");
    }
    if(
dialogid == DIALOG_CGAMESRAISEPOKER)
    {
        if(
response) {
            new 
tableid GetPVarInt(playerid"pkrTableID")-1;
        
            new 
actualRaise strval(inputtext)-GetPVarInt(playerid"pkrCurrentBet");
            
            if(
strval(inputtext) >= PokerTable[tableid][pkrActiveBet]+PokerTable[tableid][pkrBlind]/&& strval(inputtext) <= GetPVarInt(playerid"pkrCurrentBet")+GetPVarInt(playerid"pkrChips")) {
                
PokerTable[tableid][pkrPot] += actualRaise;
                
PokerTable[tableid][pkrActiveBet] = strval(inputtext);
                
SetPVarInt(playerid"pkrChips"GetPVarInt(playerid"pkrChips")-actualRaise);
                
SetPVarInt(playerid"pkrCurrentBet"PokerTable[tableid][pkrActiveBet]);
                
                
SetPVarString(playerid"pkrStatusString""Raise");
                
                
PokerTable[tableid][pkrRotations] = 0;
                
PokerRotateActivePlayer(tableid);
                
                
ApplyAnimation(playerid"CASINO""cards_raise"4.1011111);
            } else {
                
ShowCasinoGamesMenu(playeridDIALOG_CGAMESRAISEPOKER);
            }
        }
        
        
DeletePVar(playerid"pkrActionChoice");
    }
    return 
0;

I have used this filterscript which spikes bug OnDialogResponse
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)