Raised This Month: $ Target: $400
 0% 

[HELP] stack error problem


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-08-2016 , 13:37   Re: [HELP] stack error problem
Reply With Quote #41

I did not receive PM.
__________________
Arkshine is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 03-08-2016 , 14:03   Re: [HELP] stack error problem
Reply With Quote #42

cause of The text that you have entered is too long (11483 characters). Please shorten it to 8000 characters long.
so i send it in 2 msgs
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-08-2016 , 14:50   Re: [HELP] stack error problem
Reply With Quote #43

There surely is some other plugin causing your hook to recurs. This code should stop the hook from recurring.
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < roundcontrol >

new g_iRegistered;

public 
plugin_init()
{
    
register_event"DeathMsg""death""a" );
    
g_iRegistered true;
}    

public 
death( )
{
    if(!
g_iRegistered)
        return;
        
    
g_iRegistered false;
    
    new 
players32 ], iNum
    get_players
playersiNum"a" )
    
    if( 
iNum == )
    {
        
RoundEndForceControl(WINSTATUS_DRAW);
    }
    
    if( 
iNum == )
    {
        switch( 
cs_get_user_teamplayers [0]) )
        {
            case 
CS_TEAM_T:
                
RoundEndForceControl(WINSTATUS_TERRORIST);
            case 
CS_TEAM_CT:
                
RoundEndForceControl(WINSTATUS_CT);
        }
    }    
    
    
g_iRegistered true;


Last edited by klippy; 03-08-2016 at 14:50.
klippy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 03-08-2016 , 17:36   Re: [HELP] stack error problem
Reply With Quote #44

i will try it
thnx alot
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 03-09-2016 , 18:39   Re: [HELP] stack error problem
Reply With Quote #45

Quote:
Originally Posted by Arkshine View Post
@addons_zz Your strategy is bad and is a complete non sense.
Its whole thing happens on a matter of minutes.

Quote:
Originally Posted by Arkshine View Post
If you can't understand what is the actual issue, you can't guarantee issue won't be still there.
I am just talking about choose what issue to solve. But if on both cases they are the same, you just waist some time looking for a simpler one.

Quote:
Originally Posted by Arkshine View Post
Blindly proposing things is really a waste of time for everyone. Try first to figure out why you get a recursion here so you can prevent it next time.
That is spirit now you know the problem. I was just saying to check if the other stuff are also broken. Or I didn't thought straight and just said bullshit, what matters, he is big boy and and know what is better for him, to keep on that code or try another approach.

Quote:
Originally Posted by KliPPy View Post
There surely is some other plugin causing your hook to recurs. This code should stop the hook from recurring.
This work if it is a recursion. So, probably do not needed but in case it is something elsewhere use a task to delay the unlock. Accurately, this is not a fix this is more like a kludge. He have to find what or plugin is causing such repeated call.
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < roundcontrol >

#define TASKID_UNLOCK_MY_DEATH_EVENT 15168416

new g_isToLockMyDeathEvent;

public 
plugin_init()
{
    
register_event"DeathMsg""death""a" );
}

public 
death( )
{
    if(
g_isToLockMyDeathEvent)
        return;
        
    
g_isToLockMyDeathEvent true;
    
    new 
players32 ], iNum
    get_players
playersiNum"a" )
    
    if( 
iNum == )
    {
        
RoundEndForceControl(WINSTATUS_DRAW);
    }
    
    if( 
iNum == )
    {
        switch( 
cs_get_user_teamplayers [0]) )
        {
            case 
CS_TEAM_T:
                
RoundEndForceControl(WINSTATUS_TERRORIST);
            case 
CS_TEAM_CT:
                
RoundEndForceControl(WINSTATUS_CT);
        }
    }    
    
    
set_task10.0"unlockMyDeathEvent"TASKID_UNLOCK_MY_DEATH_EVENT )
}

public 
unlockMyDeathEvent()
{
    
g_isToLockMyDeathEvent false;

__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 03-09-2016 at 19:20. Reason: fixed recursion concept
addons_zz is offline
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 03-09-2016 , 23:44   Re: [HELP] stack error problem
Reply With Quote #46

Have you tried:
PHP Code:
public plugin_init()
{
    
register_event"DeathMsg""dinkywinki""a" ); // just a different name for the function
}    

public 
dinkywinki() 
?
Mario AR. 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 09:17.


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