Raised This Month: $12 Target: $400
 3% 

[AMXX] Run time error 3: stack error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-02-2019 , 13:02   [AMXX] Run time error 3: stack error
Reply With Quote #1

Can someone help me? I already searched for this but I didnt find a solution for my problem.

Error log:
PHP Code:
L 09/02/2019 17:55:44: [AMXXDisplaying debug trace (plugin "skz_ejail.amxx")
L 09/02/2019 17:55:44: [AMXXRun time error 3stack error 
L 09
/02/2019 17:55:44: [AMXXDisplaying debug trace (plugin "skz_ejail.amxx")
L 09/02/2019 17:55:44: [AMXXRun time error 3stack error 
L 09
/02/2019 17:55:44: [AMXXDisplaying debug trace (plugin "skz_ejail.amxx")
L 09/02/2019 17:55:44: [AMXXRun time error 3stack error 
L 09
/02/2019 17:55:44: [AMXX]    [0skz_ejail.sma::_inicioronda (line 1057
Code on that line:
PHP Code:
new players[32], pnum
    get_players
(playerspnum"ch")
    
    if (
pnum 5)
    {
        
ColorChat (0GREY"^01[^04eJail^01] ^03O ^04ranking eJails^03 inicia com^04 5 ou mais jogadores ^03dentro do servidor (%i/5)",pnum)
        
skStats false 
    

skatz_ws is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-02-2019 , 15:11   Re: [AMXX] Run time error 3: stack error
Reply With Quote #2

Show. Full. Code.
__________________

Last edited by OciXCrom; 09-02-2019 at 15:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-02-2019 , 15:25   Re: [AMXX] Run time error 3: stack error
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Show. Full. Code.
Why? The error is on that line
skatz_ws is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-02-2019 , 16:37   Re: [AMXX] Run time error 3: stack error
Reply With Quote #4

Quote:
Originally Posted by skatz_ws View Post
Why? The error is on that line
I don't see it.
Show full code or at least the entire function.
__________________
HamletEagle is offline
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-03-2019 , 06:00   Re: [AMXX] Run time error 3: stack error
Reply With Quote #5

I hook the roundstart on plugin init

PHP Code:
register_event        "HLTV",         "_inicioronda""a","1=0","2=0"    ); 
Complete function:

PHP Code:
public _inicioronda()
{
    new 
iEntity;
    
    while( ( 
iEntity find_ent_by_classiEntity"func_button" ) ) > call_thinkiEntity );
    
    new 
players[32], pnum
    get_players
(playerspnum"ch")
    if (
pnum 5)
    {
        
ColorChat (0GREY"^01[^04eJail^01] ^03O ^04ranking eJails^03 inicia com^04 5 ou mais jogadores ^03dentro do servidor (%i/5)",pnum)
        
skStats false 
    
}
    else 
skStats true
    
    set_task 
(1.0,    "_escolha",             TASK_ESCOLHER_REI);
    
set_task (59.0,    "_microfonesupervip",     TASK_MICROFONE);
    
set_task (179.0"_avisoconduta",         TASK_CONDUTA);
    
set_task (419.0"_acabardia",             TASK_DIA);

The error is always pointed to "new players[32], pnum" line


EDIT: I found a guy with the same error: https://forums.alliedmods.net/showthread.php?t=258465
And he uses #pragma dynamic just like me. Can it possibily be the error?

Last edited by skatz_ws; 09-03-2019 at 06:05.
skatz_ws is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-03-2019 , 06:51   Re: [AMXX] Run time error 3: stack error
Reply With Quote #6

stack error means you filled the entire stack(the place where variables are stored). pragma dynamic allows to change the amount of space allocated for the stack so if you put a small number there, then yes: it could be the reason.
__________________
HamletEagle is offline
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-03-2019 , 07:01   Re: [AMXX] Run time error 3: stack error
Reply With Quote #7

Stack/heap size: 131072 bytes; max. usage is unknown, due to recursion

#pragma dynamic 32768

I have to put more?

And yes, I have a lot of variables inside the plugin

Last edited by skatz_ws; 09-03-2019 at 07:02.
skatz_ws is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-03-2019 , 09:11   Re: [AMXX] Run time error 3: stack error
Reply With Quote #8

Just a shot, I'm tired and couldn't test.

HTML Code:
public _inicioronda()
{
    new iEntity = -1;
    
    while( ( iEntity = find_ent_by_class( iEntity, "func_button" ) ) != 0 ) call_think( iEntity );
    
    new players[32], pnum
    get_players(players, pnum, "ch")
    if (pnum < 5)
    {
        ColorChat (0, GREY, "^01[^04eJail^01] ^03O ^04ranking eJails^03 inicia com^04 5 ou mais jogadores ^03dentro do servidor (%i/5)",pnum)
        skStats = false
        break

    }
    else skStats = true
    
    set_task (1.0,    "_escolha",             TASK_ESCOLHER_REI);
    set_task (59.0,    "_microfonesupervip",     TASK_MICROFONE);
    set_task (179.0, "_avisoconduta",         TASK_CONDUTA);
    set_task (419.0, "_acabardia",             TASK_DIA);
}
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-03-2019 , 12:11   Re: [AMXX] Run time error 3: stack error
Reply With Quote #9

Can you also show call_think
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-03-2019 , 12:16   Re: [AMXX] Run time error 3: stack error
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
Can you also show call_think
https://www.amxmodx.org/api/engine/call_think
__________________
edon1337 is offline
Reply


Thread Tools
Display Modes

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 09:34.


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