AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 3: stack error (https://forums.alliedmods.net/showthread.php?t=173408)

Diegorkable 12-04-2011 14:16

Run time error 3: stack error
 
Hey guys.

I have a problem with my plugin, that it logs errors on the error_logs files with a runtime error, stack error ( as you can see in the thread title ).

These are the errors I get:

Code:

L 12/04/2011 - 21:09:36: [AMXX] Displaying debug trace (plugin "pimpdr.amxx")
L 12/04/2011 - 21:09:36: [AMXX] Run time error 3: stack error
L 12/04/2011 - 21:09:36: [AMXX]    [0] pimpdr.sma::free_round (line 549)
L 12/04/2011 - 21:09:36: [AMXX] Displaying debug trace (plugin "pimpdr.amxx")
L 12/04/2011 - 21:09:36: [AMXX] Run time error 3: stack error
L 12/04/2011 - 21:09:36: [AMXX]    [0] ColorChat2.inc::ColorChat (line 63)
L 12/04/2011 - 21:09:36: [AMXX]    [1] pimpdr.sma::free_round (line 549)
L 12/04/2011 - 21:09:36: [AMXX] Displaying debug trace (plugin "pimpdr.amxx")
L 12/04/2011 - 21:09:36: [AMXX] Run time error 3: stack error
L 12/04/2011 - 21:09:36: [AMXX]    [0] ColorChat2.inc::Team_Info (line 84)
L 12/04/2011 - 21:09:36: [AMXX]    [1] ColorChat2.inc::ColorSelection (line 98)
L 12/04/2011 - 21:09:36: [AMXX]    [2] ColorChat2.inc::ColorChat (line 64)
L 12/04/2011 - 21:09:36: [AMXX]    [3] pimpdr.sma::free_round (line 549)

And all the error logs are coming from my plugin, pimpdr.sma, on line 549. I tried to check, the server crashed once. I checked the time it crashed and compared it to the error log, it was the same time, meaning it must had made it crash.

This is the public free_round, all it does simply that when you pick up a weapon, it strips it (using client_cmd("weapon_knife") isnt efficient cuz ppl can bug it and still use the weapon) (Activated when someone activates a free round, I guess you know what a free round might be on DEATHRUN plugin)

PHP Code:

public plugin_init()
{
        
// ......

        
register_event("CurWeapon""free_round""be""1=1""2!29");
}

public 
free_round(id)
{
    if ( !
is_user_alive(id) || !is_user_connected(id) )
        return;
        
    else if ( 
g_FreeRound )
    {
        
strip_user_weapons(id)
        
give_item(id"weapon_knife");
        
ColorChat(idRED"%s ^3You can not ^4switch weapons^3 on a ^4Free Round^3!"PREFIX_COLOR)
    }


Is there something wrong with what I do?

Bos93 12-04-2011 14:39

Re: Run time error 3: stack error
 
else if ( g_FreeRound )

-->

if ( g_FreeRound )


and Check is_user_alive contains check is_user_connected

Diegorkable 12-04-2011 16:15

Re: Run time error 3: stack error
 
So this is why I get the errors?

fysiks 12-04-2011 20:35

Re: Run time error 3: stack error
 
Quote:

Originally Posted by Diegorkable (Post 1607826)
So this is why I get the errors?

No. His suggestion changes nothing.

The errors you posted are strange (not consistent). If I had to guess, it's something entirely unrelated causing it. Maybe somebody else will know more about stack errors.

jim_yang 12-04-2011 20:56

Re: Run time error 3: stack error
 
public free_round(id)
{
if ( g_FreeRound )
{
engclient_cmd(id, "weapon_knife");
}
}

Diegorkable 12-07-2011 09:29

Re: Run time error 3: stack error
 
Quote:

Originally Posted by jim_yang (Post 1607934)
public free_round(id)
{
if ( g_FreeRound )
{
engclient_cmd(id, "weapon_knife");
}
}

can you read the fucking thread before you post...?


All times are GMT -4. The time now is 11:54.

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