Raised This Month: $ Target: $400
 0% 

Stack Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 04-24-2011 , 11:45   Stack Error
Reply With Quote #1

Code:
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] lastrequest.sma::Event_DeathMsg (line 210)
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] lastrequest.sma::Event_DeathMsg (line 210)
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] lastrequest.sma::Event_DeathMsg (line 210)
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] colorchat.inc::FindPlayer (line 118)
L 04/24/2011 - 11:35:35: [AMXX]    [1] colorchat.inc::ColorChat (line 59)
L 04/24/2011 - 11:35:35: [AMXX]    [2] lastrequest.sma::Event_DeathMsg (line 214)
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] lastrequest.sma::CheckLastRequest (line 251)
L 04/24/2011 - 11:35:35: [AMXX]    [1] lastrequest.sma::Event_DeathMsg (line 224)
L 04/24/2011 - 11:35:35: [AMXX] Displaying debug trace (plugin "lastrequest.amxx")
L 04/24/2011 - 11:35:35: [AMXX] Run time error 3: stack error 
L 04/24/2011 - 11:35:35: [AMXX]    [0] lastrequest.sma::CheckLastRequest (line 262)
L 04/24/2011 - 11:35:35: [AMXX]    [1] lastrequest.sma::Event_DeathMsg (line 224)
PHP Code:
public Event_DeathMsg()
{
    new 
iKiller read_data);
    new 
iVictim read_data);
    
    if( !
is_user_aliveiKiller ) || !is_user_connectediVictim ) )
        return 
PLUGIN_HANDLED;
    
    if( !
is_user_connectedg_iPrisoner ) || !is_user_connectedg_iGuard ) )
        return 
PLUGIN_HANDLED;
    
    if( 
g_bLREnabled )
        return 
PLUGIN_HANDLED;
        
    
    if( 
g_iType == ONEVSONE )
    {
        if( ( 
iVictim == g_iGuard || iVictim == g_iPrisoner ) )
        {
            new 
iReturn;
            
ExecuteForwardg_fwdGameStoppediReturng_iLastRequestChoseniKilleriVictim );
            
            new 
szName[32]; // Line 210
            
get_user_nameg_iPrisonerszName31 );
            
            if( 
iKiller == g_iPrisoner )
                
ColorChat0GREEN"[Jailbreak] ^03%s ^01won the ^03Last Request^01."szName ); // Line 214
            
            
else
                
ColorChat0GREEN"[Jailbreak] ^03%s ^01lost the ^03Last Request^01."szName );
            
            
g_iLastRequestChosen = -1;
            
g_iGuard 0;
            
g_iPrisoner 0;
            
g_iType 0;
            
            
CheckLastRequest(); // Line 224
        
}
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CheckLastRequest()
{
    new 
iPlayers[32], iNum// Line 251
    
get_playersiPlayersiNum"a" );
    
    new 
iCounterTerroristsiTerrorists;
    
    new 
iPlayer;
    
    for( new 
0iNumi++ )
    {
        
iPlayer iPlayers[i];
        
        if( !
is_user_aliveiPlayer ) ) //Line 262
            
continue;
            
        switch( 
cs_get_user_teamiPlayer ) )
        {
            case 
CS_TEAM_CT:
            {
                
iCounterTerrorists++;
            }
            
            case 
CS_TEAM_T:
            {
                
iTerrorists++;
            }
        }
    }
    
    if( 
iTerrorists == && iCounterTerrorists )
    {
        
ColorChat0GREEN"[Jailbreak] ^03Last Request ^01is now ^03enabled^01." );
        
g_bLREnabled true;
    }

Get this error every time somebody dies, and the server crashes.

Any Ideas?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-24-2011 , 11:53   Re: Stack Error
Reply With Quote #2

Which are lines 59, 118, 210, 224, 251, 262?
__________________

SonicSonedit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-24-2011 , 12:05   Re: Stack Error
Reply With Quote #3

Quote:
Originally Posted by SonicSonedit View Post
Which are lines 59, 118, 210, 224, 251, 262?
He lists them as comments in the code. They seem to be inconsistent.
__________________
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 04-24-2011 , 12:08   Re: Stack Error
Reply With Quote #4

Those two functions are separated by another function in the actual code, so they skip line numbers.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-24-2011 , 12:17   Re: Stack Error
Reply With Quote #5

fysiks
Quote:
He lists them as comments in the code. They seem to be inconsistent.
Sorry, i'm blind idiot.

nikhilgupta345
1) change
PHP Code:
public CheckLastRequest()
{
    new 
iPlayers[32], iNum// Line 251
    
get_playersiPlayersiNum"a" );
    
    new 
iCounterTerroristsiTerrorists;
    
    new 
iPlayer;
    
    for( new 
0iNumi++ )
    {
        
iPlayer iPlayers[i];
        
        if( !
is_user_aliveiPlayer ) ) //Line 262
            
continue;
            
        switch( 
cs_get_user_teamiPlayer ) )
        {
            case 
CS_TEAM_CT:
            {
                
iCounterTerrorists++;
            }
            
            case 
CS_TEAM_T:
            {
                
iTerrorists++;
            }
        }
    }
    
    if( 
iTerrorists == && iCounterTerrorists )
    {
        
ColorChat0GREEN"[Jailbreak] ^03Last Request ^01is now ^03enabled^01." );
        
g_bLREnabled true;
    }

to
PHP Code:
public CheckLastRequest()
{    
    new 
iCounterTerroristsiTerrorists
    g_bLREnabled
=false
    
    
for(new id=1;id<=g_maxplayers;id++)
    {
        
        if (!
is_user_connected(id))
            continue
        
        if (!
is_user_alive(id))
            continue
            
        switch(
cs_get_user_team(id))
        {
            case 
CS_TEAM_CT:
                
iCounterTerrorists++
    
            case 
CS_TEAM_T:
                
iTerrorists++
        }
    }
    
    if(
iTerrorists==1&&iCounterTerrorists)
    {
        
ColorChat0GREEN"[Jailbreak] ^03Last Request ^01is now ^03enabled^01." )
        
g_bLREnabled=true
    
}

get_players aswell as get_user_weapons are rather buggy functions.
__________________


Last edited by SonicSonedit; 04-24-2011 at 12:26.
SonicSonedit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-24-2011 , 12:30   Re: Stack Error
Reply With Quote #6

get_players() works perfectly fine. The only time that I've seen anything mentioned about it being buggy was using the team flag.

If you notice, the error is does not involve get_players() it is with declaring the variables it uses.
__________________

Last edited by fysiks; 04-24-2011 at 12:32.
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 04-24-2011 , 12:30   Re: Stack Error
Reply With Quote #7

The stack error in the function CheckLastRequest() is gone, but the one in deathmsg still exists.

Errors indicate the same lines 210 and 214 from the first post.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-24-2011 , 13:01   Re: Stack Error
Reply With Quote #8

fysiks
Quote:
get_players() works perfectly fine.
Sometimes it returns incorrect players, sometimes it returns duplicates, i don't know, maybe i really used it incorrectly, but i prefer not to use it. Anyway, it's more about personal opinion. Afterall, nothing will ever be as buggy as fun module.
By the way, can you take a look at http://forums.alliedmods.net/showthread.php?t=155608 ?

nikhilgupta345
Try this:
PHP Code:
public Event_DeathMsg()
{
    static 
iKilleriVictimiReturnname[32]
    
iKiller=read_data(1)
    
iVictim=read_data(2)
    
    if (!
is_user_connected(iVictim)||!is_user_connected(g_iGuard)||!is_user_connected(g_iPrisoner))
        return 
PLUGIN_HANDLED

    
if (!is_user_alive(iKiller)||g_bLREnabled||g_iType!=ONEVSONE)
        return 
PLUGIN_HANDLED

    
if ((iVictim!=g_iGuard&&Victim!=g_iPrisoner))
        return 
PLUGIN_HANDLED

    ExecuteForward
(g_fwdGameStoppediReturng_iLastRequestChoseniKilleriVictim)
    
get_user_name(g_iPrisonernamecharsmax(name))
            
    if (
iKiller==g_iPrisoner)
        
ColorChat(0GREEN"[Jailbreak] ^03%s ^01won the ^03Last Request^01."name// Line 214
    
else
        
ColorChat(0GREEN"[Jailbreak] ^03%s ^01lost the ^03Last Request^01."name)
            
    
g_iLastRequestChosen = -1;
    
g_iGuard 0;
    
g_iPrisoner 0;
    
g_iType 0;
            
    
CheckLastRequest()
    
    return 
PLUGIN_HANDLED;

__________________


Last edited by SonicSonedit; 04-24-2011 at 13:20.
SonicSonedit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-24-2011 , 13:14   Re: Stack Error
Reply With Quote #9

Quote:
Originally Posted by SonicSonedit View Post
Anyway, it's more about personal opinion.
It's computer code. It's not personal opinion if it works correctly or not. I've never heard of it not working other than when trying to filter teams.
__________________
fysiks is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-24-2011 , 13:16   Re: Stack Error
Reply With Quote #10

Quote:
It's computer code. It's not personal opinion if it works correctly or not. I've never heard of it not working other than when trying to filter teams.
Well, now you did
And about my thread, any thoughts?
__________________

SonicSonedit is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 20:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode