Raised This Month: $32 Target: $400
 8% 

Stack error - Update


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 09-07-2012 , 22:34   Stack error - Update
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <fun>
#include <cl_buy>

new pcvar;

public 
plugin_init() {
    
RegisterHam(Ham_Killed"player""FwdPlayerKilled"1);
    
    
register_event("StatusIcon""c4Dropped""be""1=1""1=2""2=c4");
    
register_event("DeathMsg""Event_DeathMsg""a");
    
    
register_forward(FM_SetModel"Fw_SetModel");

    
register_menucmd(register_menuid("Terrorist_Select"1), 511"JoinClass");
    
register_menucmd(register_menuid("CT_Select"1), 511"JoinClass");
    
    
pcvar register_cvar("resp_enabled""1");
}

public 
Event_DeathMsg() {
    if(
get_pcvar_num(pcvar)) {
        
//new iKiller = read_data(1);
        
new iVictim read_data(2);
        
        if(
is_user_connected(iVictim)) {
            
cs_set_user_defuse(iVictim0);
            
set_pev(iVictimpev_body0);
        }
    }
}

public 
FwdPlayerKilled(iPlayer) {
    if(
get_pcvar_num(pcvar)) {
        if(
is_user_connected(iPlayer)) {
            
set_task(1.35"RespawnPlayer"iPlayer);
        }
    }
}

public 
RespawnPlayer(iPlayer) {
    if(
get_pcvar_num(pcvar) && is_user_connected(iPlayer)) {
        if(!
is_user_alive(iPlayer)) {
            
ExecuteHamB(Ham_CS_RoundRespawniPlayer);
        }
        
cs_set_user_money(iPlayer16000);

        
set_user_godmode(iPlayer1);
        
set_task(3.0"GodModeRemove"iPlayer);
    }
}

public 
GodModeRemove(iPlayer) {
    if(
is_user_connected(iPlayer) && is_user_alive(iPlayer)) {
        
set_user_godmode(iPlayer0);
    }
}

public 
JoinClass(iPlayer) {
    if(
get_pcvar_num(pcvar)) {
        if(!
is_user_alive(iPlayer)) {
            
set_task(1.35"RespawnPlayer"iPlayer);
        }
    }
}

public 
Fw_SetModel(iEnt, const iModel[]) {
    if(
get_pcvar_num(pcvar)) {
        static 
iClass[10];
    
        
pev(iEntpev_classnameiClasssizeof iClass 1);
    
        if(
equal(iClass"weaponbox")) {
            
set_pev(iEntpev_nextthinkget_gametime() + 20.0);
        }
    }
}

public 
client_buy(iPlayeriItem) {
    if(
get_pcvar_num(pcvar)) {
        if(
iItem == CSW_FLASHBANG && !user_has_weapon(iPlayerCSW_FLASHBANG)
        || 
iItem == CSW_HEGRENADE && !user_has_weapon(iPlayerCSW_HEGRENADE)
        || 
iItem == CSW_SMOKEGRENADE && !user_has_weapon(iPlayerCSW_SMOKEGRENADE)) {
            return 
PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
c4Dropped(iPlayer) {
    if(
get_pcvar_num(pcvar)) {
        new 
fwd register_forward(FM_SetModel"C4_Drop_SetModel"true);
        
engclient_cmd(iPlayer"drop""weapon_c4");
        
unregister_forward(FM_SetModelfwdtrue);
    }


public 
C4_Drop_SetModel(entmodel[]) { 
    if(!
equal(model"model/weaponbox.mdl")) 
        
dllfunc(DLLFunc_Thinkent);

Code:
L 08/21/2012 - 22:14:11: Start of error session.
L 08/21/2012 - 22:14:11: Info (map "de_tuscan") (file "addons/amxmodx/logs/error_20120821.log")
L 08/21/2012 - 22:14:11: [AMXX] Displaying debug trace (plugin "respawn.amxx")
L 08/21/2012 - 22:14:11: [AMXX] Run time error 3: stack error 
L 08/21/2012 - 22:14:11: [AMXX] Displaying debug trace (plugin "respawn.amxx")
L 08/21/2012 - 22:14:11: [AMXX] Run time error 3: stack error 
L 08/21/2012 - 22:14:11: [AMXX] Displaying debug trace (plugin "respawn.amxx")
L 08/21/2012 - 22:14:11: [AMXX] Run time error 3: stack error
* This crash my server...
__________________

Last edited by kramesa; 10-03-2012 at 11:42.
kramesa is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 09-07-2012 , 23:16   Re: Stack error.
Reply With Quote #2

I don't believe that plugin is causing the issue. The way I understand it is that stack errors are related to memory issues ( ? ) . You should show what other plugins your running - I think you'll find that the plugin you posted will work fine.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-08-2012 , 01:20   Re: Stack error.
Reply With Quote #3

Remove
Code:
    engclient_cmd(iPlayer, "drop", "weapon_c4");
and try again the plugin.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-03-2012 , 11:42   Re: Stack error.
Reply With Quote #4

Quote:
Originally Posted by OvidiuS View Post
Remove
Code:
    engclient_cmd(iPlayer, "drop", "weapon_c4");
and try again the plugin.
Crash =x

Look at this new plugin, it's give same error.
__________________
kramesa is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 10-03-2012 , 11:48   Re: Stack error.
Reply With Quote #5

Quote:
Originally Posted by kramesa View Post
Crash =x

Look at this new plugin, it's give same error.
Dude, remove that line from your plugin.
You still have it in:
Code:
public c4Dropped(iPlayer) {     if(get_pcvar_num(pcvar)) {         new fwd = register_forward(FM_SetModel, "C4_Drop_SetModel", true);         engclient_cmd(iPlayer, "drop", "weapon_c4");         unregister_forward(FM_SetModel, fwd, true);     } }
OvidiuS is offline
Send a message via Skype™ to OvidiuS
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-03-2012 , 12:24   Re: Stack error.
Reply With Quote #6

Quote:
Originally Posted by OvidiuS View Post
Dude, remove that line from your plugin.
You still have it in:
Code:
public c4Dropped(iPlayer) {     if(get_pcvar_num(pcvar)) {         new fwd = register_forward(FM_SetModel, "C4_Drop_SetModel", true);         engclient_cmd(iPlayer, "drop", "weapon_c4");         unregister_forward(FM_SetModel, fwd, true);     } }
I already removed and tested. I only put that line for post the plugin.
__________________
kramesa 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 23:09.


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