Raised This Month: $ Target: $400
 0% 

Run time error 1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-11-2022 , 00:25   Run time error 1
Reply With Quote #1

Code:
L 05/10/2022 - 18:46:03: Start of error session.
L 05/10/2022 - 18:46:03: Info (map "jb_oasis") (file "addons/amxmodx/logs/error_20220510.log")
L 05/10/2022 - 18:46:03: [AMXX] Plugin ("jb_parachute.amxx") is setting itself as failed.
L 05/10/2022 - 18:46:03: [AMXX] Plugin says:  jb_oasis
L 05/10/2022 - 18:46:03: [AMXX] Run time error 1 (plugin "jb_parachute.amxx") - forced exit
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <cstrike>
#include <fun>
#include <jailbreak_core>

#if AMXX_VERSION_NUM > 182
#define client_disconnect client_disconnected
#endif

new bool:g_has_parachute[33], g_IsUserAlive;
new 
g_para_ent[33];
new 
g_pDetachg_pFallSpeedg_p_shopitem_para;

#define PARACHUTE_LEVEL ADMIN_LEVEL_A

public plugin_init()
{
    
register_plugin("[JB] Parachute""1.0""Natsheh");
    
g_pFallSpeed register_cvar("parachute_fallspeed""100");
    
g_pDetach register_cvar("parachute_detach""1");

    
register_concmd("amx_parachute""admin_give_parachute"PARACHUTE_LEVEL"<nick, #userid or @team>" );

    
register_event("DeathMsg""death_event""a");
    
RegisterHam(Ham_Spawn"player""newSpawn"true);

    
g_p_shopitem_para register_jailbreak_shopitem("Parachute""Smoothes the landing"5000TEAM_ANY);
}

public 
jb_shop_item_preselect(iditemid)
{
    if(
g_p_shopitem_para == itemid)
    {
        if(
g_has_parachuteid ]) return JB_MENU_ITEM_UNAVAILABLE;
    }

    return 
JB_IGNORED;
}

public 
jb_shop_item_bought(iditemid)
{
    if(
g_p_shopitem_para == itemid)
    {
        
g_has_parachuteid ] = true;
    }
}

public 
plugin_precache()
{
    
precache_model("models/parachute.mdl");
}

public 
client_connect(id)
{
    
parachute_reset(id)
}

public 
client_disconnect(id)
{
    
parachute_reset(id)
}

public 
death_event()
{
    const 
VICTIM_ARGUMENT 2;
    new 
iVictim read_dataVICTIM_ARGUMENT );
    
remove_flag(g_IsUserAlive,iVictim);
    
parachute_resetiVictim );
}

parachute_reset(id)
{
    new 
parachute g_para_ent[id];

    if(
parachute 0)
    {
        
entity_set_int(parachuteEV_INT_flagsFL_KILLME);
        
call_think(parachute);
    }

    
g_has_parachute[id] = false;
    
g_para_ent[id] = 0;
}

public 
newSpawn(id)
{
    if(!
is_user_alive(id)) return;

    
set_flag(g_IsUserAlive,id);

    new 
parachute g_para_ent[id];

    if(
parachute 0)
    {
        
entity_set_int(parachuteEV_INT_flagsFL_KILLME);
        
call_think(parachute);
        
g_para_ent[id] = 0;
    }

    if ( 
access(idPARACHUTE_LEVEL) )
    {
        
g_has_parachute[id] = true;
    }
}

public 
admin_give_parachute(idlevelcid) {

    if(!
cmd_access(id,level,cid,2)) return PLUGIN_HANDLED

    
new arg[32], name[32], authid[35];
    
read_argv(1,arg,31);
    
get_user_name(id,name,31);
    
get_user_authid(id,authid,34);

    if (
arg[0]=='@')
    {
        new 
players[32], inum;
        switch ( 
arg[1] )
        {
            case 
'T'get_players(playersinum"he""TERRORIST");
            case 
'C'get_players(playersinum"he""CT");
            default :    
get_players(playersinum"h");
        }

        if (
inum == 0) {
            
console_print(id,"No clients in such team");
            return 
PLUGIN_HANDLED;
        }

        for(new 
0inuma++)
        {
            
g_has_parachuteplayers[a] ] = true;
        }

        switch(
get_cvar_num("amx_show_activity")) {
            case 
2:    client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^" players",name,arg[1])
            case 
1:    client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^" players",arg[1])
        }

        
console_print(id,"[AMXX] You gave a parachute to ^"%s^" players",arg[1])
        
log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s^""name,get_user_userid(id),authid,arg[1])
    }
    else
    {
        new 
player cmd_target(idargCMDTARGET_ALLOW_SELF)
        if (!
player) return PLUGIN_HANDLED;

        
g_has_parachute[player] = true;

        new 
authid2[35], name2[32];
        
get_user_name(player,name2,31);
        
get_user_authid(player,authid2,34);

        switch(
get_cvar_num("amx_show_activity")) {
            case 
2:    client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^"",name,name2)
            case 
1:    client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^"",name2)
        }

        
console_print(id,"[AMXX] You gave a parachute to ^"%s^""name2)
        
log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s<%d><%s><>^""name,get_user_userid(id),authid,name2,get_user_userid(player),authid2)
    }
    return 
PLUGIN_HANDLED
}

public 
client_PreThink(id)
{
    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    //2 - detach - 29 frames

    
if (!check_flag(g_IsUserAlive,id) || !g_has_parachute[id]) return;

    static 
buttonoldbuttonflagsFloat:fFrame 0.0;
    
button get_user_button(id);
    
oldbutton get_user_oldbutton(id);
    
flags get_entity_flags(id);

    static 
para_ent 0;
    
para_ent g_para_ent[id];

    if (
para_ent && (flags FL_ONGROUND)) {

        static 
bDetach 0bDetach = !bDetach get_pcvar_num(g_pDetach):bDetach;
        if (
bDetach)
        {

            if (
entity_get_int(para_ent,EV_INT_sequence) != 2) {
                
entity_set_int(para_entEV_INT_sequence2);
                
entity_set_int(para_entEV_INT_gaitsequence1);
                
entity_set_float(para_entEV_FL_frame0.0);
                
entity_set_float(para_entEV_FL_fuser10.0);
                
entity_set_float(para_entEV_FL_animtime0.0);
                
entity_set_float(para_entEV_FL_framerate0.0);
                return
            }

            
fFrame entity_get_float(para_ent,EV_FL_fuser1) + 2.0;
            
entity_set_float(para_ent,EV_FL_fuser1,fFrame);
            
entity_set_float(para_ent,EV_FL_frame,fFrame);

            if (
fFrame 254.0)
            {
                
entity_set_int(para_entEV_INT_flagsFL_KILLME);
                
call_think(para_ent);
                
g_para_ent[id] = 0;
            }
        }
        else
        {
            
entity_set_int(para_entEV_INT_flagsFL_KILLME);
            
call_think(para_ent);
            
g_para_ent[id] = 0;
        }

        return
    }

    if (
button IN_USE)
    {
        static 
Float:fFallspeed 0.0Float:velocity[3]; fFallspeed = (fFallspeed == 0.0) ? ( -get_pcvar_float(g_pFallSpeed) ) : fFallspeed;
        
entity_get_vector(idEV_VEC_velocityvelocity)

        if (
velocity[2] < 0.0) {

            if(
para_ent <= 0) {
                
para_ent create_entity("info_target")
                if(
para_ent 0)
                {
                    
g_para_ent[id] = para_ent;
                    
entity_set_string(para_ent,EV_SZ_classname,"parachute");
                    
entity_set_edict(para_entEV_ENT_aimentid);
                    
entity_set_edict(para_entEV_ENT_ownerid);
                    
entity_set_int(para_entEV_INT_movetypeMOVETYPE_FOLLOW);
                    
entity_set_model(para_ent"models/parachute.mdl");
                    
entity_set_int(para_entEV_INT_sequence0);
                    
entity_set_int(para_entEV_INT_gaitsequence1);
                    
entity_set_float(para_entEV_FL_frame0.0);
                    
entity_set_float(para_entEV_FL_fuser10.0);
                }
            }

            if (
para_ent 0) {

                
entity_set_int(idEV_INT_sequence3)
                
entity_set_int(idEV_INT_gaitsequence1)
                
entity_set_float(idEV_FL_frame1.0)
                
entity_set_float(idEV_FL_framerate1.0)

                
velocity[2] = (velocity[2] + 40.0 fFallspeed) ? velocity[2] + 40.0 fFallspeed
                entity_set_vector
(idEV_VEC_velocityvelocity)

                if (
entity_get_int(para_ent,EV_INT_sequence) == 0) {

                    
fFrame entity_get_float(para_ent,EV_FL_fuser1) + 1.0
                    entity_set_float
(para_ent,EV_FL_fuser1,fFrame)
                    
entity_set_float(para_ent,EV_FL_frame,fFrame)

                    if (
fFrame 100.0) {
                        
entity_set_float(para_entEV_FL_animtime0.0)
                        
entity_set_float(para_entEV_FL_framerate0.4)
                        
entity_set_int(para_entEV_INT_sequence1)
                        
entity_set_int(para_entEV_INT_gaitsequence1)
                        
entity_set_float(para_entEV_FL_frame0.0)
                        
entity_set_float(para_entEV_FL_fuser10.0)
                    }
                }
            }
        }
        else if (
para_ent 0) {
            
entity_set_int(para_entEV_INT_flagsFL_KILLME);
            
call_think(para_ent);
            
g_para_ent[id] = 0;
        }
    }
    else if ((
oldbutton IN_USE) && para_ent ) {
        
entity_set_int(para_entEV_INT_flagsFL_KILLME);
        
call_think(para_ent);
        
g_para_ent[id] = 0
    
}

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-11-2022 at 00:26.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-11-2022 , 01:00   Re: Run time error 1
Reply With Quote #2

It happens only Jb oasis or on more maps? also do you have any set_fail_state() on your jb core ?

does your Jb core uses MySql? Some force exit when the connection can't be done but that may be not the cause i suppose .
__________________
Project: Among Us

Last edited by Craxor; 05-11-2022 at 01:04.
Craxor is offline
Send a message via ICQ to Craxor
zXCaptainXz
Member
Join Date: May 2017
Old 05-19-2022 , 13:51   Re: Run time error 1
Reply With Quote #3

Quote:
Originally Posted by Craxor View Post
also do you have any set_fail_state() on your jb core ?
Can you answer his question? What's in your jailbreak_core.inc file?
zXCaptainXz is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-20-2022 , 05:40   Re: Run time error 1
Reply With Quote #4

Quote:
Originally Posted by zXCaptainXz View Post
Can you answer his question? What's in your jailbreak_core.inc file?
Please answer the question, post the file.
__________________

Last edited by HamletEagle; 05-20-2022 at 05:55.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-21-2022 , 03:00   Re: Run time error 1
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Please answer the question, post the file.
Nothing includes set_fail_state


And another error

Code:
L 05/20/2022 - 08:27:18: Invalid player id 77
L 05/20/2022 - 08:27:18: [AMXX] Displaying debug trace (plugin "Jailbreak_main.amxx", version "2.7.0")
L 05/20/2022 - 08:27:18: [AMXX] Run time error 10: native error (native "engclient_cmd")
L 05/20/2022 - 08:27:18: [AMXX]    [0] Jailbreak_main.sma::set_user_team (line 2949)
L 05/20/2022 - 08:27:18: [AMXX]    [1] Jailbreak_main.sma::join_menu_handle (line 2834)

There is something calling the callback functions( menu handlers and set_task call functions ) randomly within the amxmodx and not from the 3rd party plugins.

I am using the latest amxx version of dev 1.10 and Metamod v1.21p38 2018/02/11


I think this issue might because because of unregister_forward inefficiently remove a forward during its call time?


Code:
static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params)
{
	int func = params[1];
	int func_id = params[2];
	int post = params[3];

	if (func >= FM_LAST_DONT_USE_ME || func < 1)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Invalid function: %d", func);
		return 0;
	}

	void *patchAddr = NULL;

	ke::Vector<int> *peng = NULL;
	if (post)
	{
		peng = &(EnginePost[func]);
		patchAddr = EngineAddrsPost[func];
	} else {
		peng = &(Engine[func]);
		patchAddr = EngineAddrs[func];
	}
	for (size_t i = 0; i < peng->length(); ++i)
	{
		if (peng->at(i) == func_id)
		{
			peng->remove(i);
			MF_UnregisterSPForward(func_id);
			if (!peng->length() && patchAddr != NULL && func != FM_ServerDeactivate)
			{
				/* Clear out this forward if we no longer need it */
				*(void **)patchAddr = NULL;
			}
			return 1;
		}
	}

	return 0;
}
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-21-2022 at 03:27.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-11-2022 , 05:41   Re: Run time error 1
Reply With Quote #6

It seems the jailbreak mod has nothing to do with the problem, ill investigate more and come with a feedback.
__________________
@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
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-13-2022 , 09:20   Re: Run time error 1
Reply With Quote #7

Happens on load or player join? Assuming on load use pfn_keyvalue to change the erroneous message value.

Code:
"message" "jb_oasis"
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-15-2022 , 02:37   Re: Run time error 1
Reply With Quote #8

Quote:
Originally Posted by DJEarthQuake View Post
Happens on load or player join? Assuming on load use pfn_keyvalue to change the erroneous message value.

Code:
"message" "jb_oasis"
Actually it happens because some defected plug in that trigger an index out of bound error probably? Then it result in a memory access error which follows a termination for rhe server ( exit code 139 LINUX ) segmentation fault 41-40
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-15-2022 at 02:38.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-17-2022 , 10:46   Re: Run time error 1
Reply With Quote #9

When I remade parachute on reset I check if the user is connected so 0 does not wedge in there; this was also due to other plugins using a think too, that helped my case. Unsure what will handle your sit.
__________________
DJEarthQuake is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-17-2022 , 13:14   Re: Run time error 1
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
Actually it happens because some defected plug in that trigger an index out of bound error probably? Then it result in a memory access error which follows a termination for rhe server ( exit code 139 LINUX ) segmentation fault 41-40
A typical index out of bounds error DOES NOT result in a segfault. The index is checked and the error is thrown before any faulty memory access will happen.
The error log you posted suggests one of your plugins is using set_fail_state to pause itself.
__________________
HamletEagle 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 00:18.


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