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

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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-11-2022 , 05:41   Re: Run time error 1
Reply With Quote #3

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 #4

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 #5

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 #6

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 #7

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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-17-2022 , 14:47   Re: Run time error 1
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
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.
yes and its the parachute plugin which got paused. but i've never used the native set_fail_state in the parachute plugin, you can check out the code in post one.
__________________
@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-17-2022 at 14:47.
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-17-2022 , 22:50   Re: Run time error 1
Reply With Quote #9

Quote:
Originally Posted by Natsheh View Post
yes and its the parachute plugin which got paused. but i've never used the native set_fail_state in the parachute plugin, you can check out the code in post one.
thats why is asked if you use set fail state in your jb core ..
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-17-2022 , 22:53   Re: Run time error 1
Reply With Quote #10

The only place in the whole of AMX Mod X that that output can be generated is in the set_fail_state() function. The "Plugin says" portion is the string provided to the set_fail_state() function.

Are you absolutely sure you're using that source code in your .amxx file? Did you compile it locally with official compilers?

If it's truly not this plugin then there would have to be a bug in the plugin pointer lookup (line) but I find that highly unlikely. Granted, if you're having a segmentation fault, I'm sure it's possible that it's just screwing up a whole bunch of stuff and presenting as a false error.
__________________
fysiks 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 21:14.


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