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

native error (native "message_begin")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Romeo8
Junior Member
Join Date: Feb 2018
Old 09-22-2018 , 17:45   native error (native "message_begin")
Reply With Quote #1

I am receiving this msg constantly if plugin grave.amxx is turned on
"Plugin called message_begin with an invalid message id (0).
L 09/22/2018 - 169:16: [AMXX] Displaying debug trace (plugin "grave.amxx")
L 09/22/2018 - 169:16: [AMXX] Run time error 10: native error (native "message_begin")
L 09/22/2018 - 169:16: [AMXX] [0] textC042CW.sma::Icon (line 372)
L 09/22/2018 - 169:16: [AMXX] [1] textC042CW.sma::hook_reset (line 251)"
As i am note some that does code how would i fix this
Romeo8 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-22-2018 , 17:47   Re: native error (native "message_begin")
Reply With Quote #2

Post the code.
__________________
edon1337 is offline
Romeo8
Junior Member
Join Date: Feb 2018
Old 09-22-2018 , 17:48   Re: native error (native "message_begin")
Reply With Quote #3

I'm sorry what code as i said im not a coder. Do you mean the sma file??
Romeo8 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-22-2018 , 17:58   Re: native error (native "message_begin")
Reply With Quote #4

Quote:
Originally Posted by Romeo8 View Post
I'm sorry what code as i said im not a coder. Do you mean the sma file??
Yes.
__________________
edon1337 is offline
Romeo8
Junior Member
Join Date: Feb 2018
Old 09-22-2018 , 18:00   Re: native error (native "message_begin")
Reply With Quote #5

Here is the sma code and thanks for looking at this
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Headshot Grave"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

#define fm_find_ent_by_class(%1,%2) engfunc( EngFunc_FindEntityByString, %1, "classname", %2 )
#define fm_remove_entity(%1) engfunc( EngFunc_RemoveEntity, %1 )

// thanks samurai
#define dmin Float:{ -2.440000, -3.540000, -4.960000 }
#define dmax Float:{ 5.880000, 3.780000, 4.750000 }

#define hsdistance     1000.0
#define radius        400.0

#define sounds        2

new const gclass[] =     "grave";
new const 
tmodel[] =     "models/gravet.mdl";
new const 
ctmodel[] =     "models/gravect.mdl";

new 
g_sounds[sounds][] =
{
    
"misc/grave_sound1.wav",
    
"misc/grave_sound2.wav"
};

new 
bool:g_Graved[33];
new 
g_explode,g_smoke,lightning;
new 
g_msgscreenfade,g_msgstatusicon;

new 
toggle_plugin,toggle_hs,toggle_touch,toggle_radius,
toggle_dmg,toggle_int,toggle_thunder,toggle_light,toggle_lighdur;
new 
p_plugin,p_hs,p_radius,p_dmg,p_int;

public 
plugin_init( ) 
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_forwardFM_Touch"fw_touch" );
    
register_forwardFM_PlayerPreThink"fw_prethink" );
    
    
register_event"HLTV""hook_newround",  "a""1=0""2=0" );
    
register_event"DeathMsg""hook_death""a" );
    
register_event"ResetHUD""hook_reset""b" );
    
    
toggle_plugin register_cvar"hsgrave_plugin""1" );
    
toggle_hs register_cvar"hsgrave_explode""1" );
    
toggle_thunder register_cvar"hsgave_thunder""1" );
    
toggle_touch register_cvar"hsgrave_touchkill""1" );
    
toggle_light register_cvar"hsgrave_light""1" );
    
toggle_lighdur register_cvar"hsgrave_lightduration""2" );
    
toggle_radius register_cvar"hsgrave_radius""1" );
    
toggle_dmg register_cvar"hsgrave_damage""5" );
    
toggle_int register_cvar"hsgrave_interval""3" );
    
    
g_msgscreenfade get_user_msgid"ScreenFade" );
    
g_msgstatusicon get_user_msgid"StatusIcon" );
}

public 
plugin_precache( )
{
    
precache_modeltmodel );
    
precache_modelctmodel );
    
precache_sound"ambience/thunder_clap.wav" );
    
    
lightning precache_model"sprites/lgtning.spr" );
    
g_explode precache_model"sprites/shockwave.spr" );
    
g_smoke precache_model"sprites/steam1.spr" );
    
    for( new 
0soundsi++ )
        
precache_sound(g_sounds[i]);
}

public 
hook_death ()
{
    if( 
p_plugin != )
        return 
PLUGIN_CONTINUE;
    
    new 
read_data);
    new 
read_data);
    new 
vteam get_user_team);
    
    if( !
|| !)
        return 
PLUGIN_CONTINUE;
    if( 
get_user_team) == vteam )
        return 
PLUGIN_CONTINUE;
    if( !
read_data) )
        return 
PLUGIN_CONTINUE;    
    
    new 
Float:korigin[3], Float:vorigin[3], Float:fdistance;
    
pevkpev_originkorigin );
    
pevvpev_originvorigin );
    
fdistance get_distance_fkoriginvorigin );
    
    if( 
fdistance >= hsdistance )
    {
        if( 
p_hs == )
        {
            
Smokevoriginrandom_num3040 ), );
            
Cylindervorigin );
        }
        
Fadev,(6<<10), (5<<10), (1<<12), 000175 );
        
        new 
ent engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"info_target" ) );
        
vorigin] -= 35;
        
engfuncEngFunc_SetOriginentvorigin );
        
        if( !
pev_valident ) )
            return 
PLUGIN_CONTINUE;
        
        
engfuncEngFunc_SetModelentvteam==tmodel ctmodel );
        
set_pevent,pev_classnamegclass );
        
dllfuncDLLFunc_Spawnent );
    
        
set_pevent,pev_solidSOLID_BBOX );
        
set_pevent,pev_movetypeMOVETYPE_FLY );
    
        
engfuncEngFunc_SetSizeentdmindmax );
        
engfuncEngFunc_DropToFloorent );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
fw_touchtouchedtoucher )
{
    if( 
p_plugin != )
        return 
FMRES_IGNORED;
    if( 
get_pcvar_num toggle_touch ) != )
        return 
FMRES_IGNORED;
    
    static 
dclass[32], rclass[32], Float:origin[3];
    
pevtouchedpev_classnamedclasssizeof dclass );
    
pevtoucherpev_classnamerclasssizeof rclass );
    
pevtoucherpev_originorigin );
    
    if( 
equali dclassgclass ) && equali rclass"player" ) )
    {
        
user_killtoucher );
        
        if( 
get_pcvar_num toggle_thunder ) == )
        {
            new 
Float:vorigin[3];
            new 
Float:pos[3];
            
pev(toucherpev_originvorigin );
            
            
vorigin] -= 26;
            
pos] = vorigin] + 150;
            
pos] = vorigin] + 150;
            
pos] = vorigin] + 800;
            
            
Thunderposvorigin );
            
Smokeorigin1010 );
            
            new 
random_num0sounds );
            
emit_sound0CHAN_ITEMg_sounds[x], 1.0ATTN_NORM0PITCH_NORM);
        }
        
        if( 
get_pcvar_numtoggle_light ) == )
        {
            
lights"d" );
            
set_taskfloatget_pcvar_numtoggle_lighdur) ), "relights");
        }
    }
    
    
    return 
FMRES_IGNORED;
}

public 
hook_newround( )
{
    new 
ent = -1;
    while( ( 
ent fm_find_ent_by_class entgclass ) ) )
        
fm_remove_entityent );
    
    
p_plugin get_pcvar_numtoggle_plugin );
    
p_hs get_pcvar_numtoggle_hs );
    
p_dmg get_pcvar_numtoggle_dmg );
    
p_int get_pcvar_numtoggle_int );
    
p_radius get_pcvar_numtoggle_radius );
}

public 
fw_prethinkid )
{
    if( 
p_plugin != )
        return 
FMRES_IGNORED;
    if( 
p_radius != )
        return 
FMRES_IGNORED;
    
    if( !
is_user_aliveid ))
        return 
FMRES_IGNORED;
    
    new 
Float:origin[3], Float:gorigin[3], Float:distance;
    new 
ent = -1;
    
pevidpev_originorigin );
    
    while(( 
ent fm_find_ent_by_classentgclass )))
    {
        
pev(ent,pev_origin,gorigin);
        
distance get_distance_forigingorigin );
        
        if( 
distance <= radius )
        {
            if(
g_Gravedid ])
                return 
FMRES_IGNORED;
            
            
g_Gravedid ] = true;
            
            
Iconid2,"dmg_gas",0,0,0);
            
Fadeid, (1<<10), (1<<10), (1<<12), 000175 );
            
            
set_taskfloat p_int ), "poison"id+123__"b" );
        
        } else {
            
g_Graved[id] = false;
            
            if( 
task_existsid+123 ))
                
remove_taskid+123 );
            
            
Iconid0"dmg_gas"00);
        }
    }
    
    return 
FMRES_IGNORED;
}

public 
poisontask )
{
    new 
index task-123;
    new 
hp get_user_healthindex );
    new 
total hp p_dmg;
    new 
name[32];
    
get_user_nameindexname31 );
    
    if( 
total <= )
    {
        
user_killindex );
        
Fadeindex, (6<<10), (5<<10), (1<<12), 000175 );
    } else
        
is_user_aliveindex ) ? set_pevindexpev_healthfloattotal ) ) : remove_taskindex );
    
    
Fadeindex, (1<<10), (1<<10), (1<<12), 00035 );    
}

public 
hook_resetid )
{
    
g_Gravedid ] = false;
    
Iconid0"dmg_gas"00);
    
    if( 
task_existsid+123 ) )
        
remove_taskid+123 );
}

public 
SmokeFloat:forigin[3], scaleframerate )
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_SMOKE );
    
write_coordfloatroundforigin[0] ) );
    
write_coordfloatroundforigin[1] ) );
    
write_coordfloatroundforigin[2] ) );
    
write_shortg_smoke );
    
write_bytescale );
    
write_byteframerate );
    
message_end();
}

public 
CylinderFloat:forigin[3] )
{
    new 
origin[3];
    
FVecIVecforiginorigin );    
    
    
CreateCylinderorigin550g_explode00660002100175);
    
CreateCylinderorigin700g_explode00660002350150);
    
CreateCylinderorigin850g_explode0066001525515100);
}

public 
relights() lights"n" );

CreateCylinderorigin[3], addradspritestartfrateframeratelifewidthamplituderedgreenbluebrightnessspeed )
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_BEAMCYLINDER );
    
write_coordorigin[0] );
    
write_coordorigin[1] );
    
write_coordorigin[2] );
    
write_coordorigin[0] );
    
write_coordorigin[1] );
    
write_coordorigin[2] + addrad );
    
write_shortsprite );
    
write_bytestartfrate );
    
write_byteframerate );
    
write_bytelife );
    
write_bytewidth );
    
write_byteamplitude );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytebrightness );
    
write_bytespeed );
    
message_end();
}

ThunderFloat:vec1[3], Float:vec2[3] )
{
    new 
ivec1[3], ivec2[3];
    
FVecIVecvec1ivec1 ); FVecIVecvec2ivec2 );
    
    
message_beginMSG_PVSSVC_TEMPENTITY ); 
    
write_byteTE_BEAMPOINTS ); 
    
write_coordivec1[0] ); 
    
write_coordivec1[1] ); 
    
write_coordivec1[2] ); 
    
write_coordivec2[0] ); 
    
write_coordivec2[1] ); 
    
write_coordivec2[2] ); 
    
write_shortlightning ); 
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte20 );
    
write_byte30 );
    
write_byte200 ); 
    
write_byte200 );
    
write_byte200 );
    
write_byte200 );
    
write_byte200 );
    
message_end();
    
    
message_beginMSG_PVSSVC_TEMPENTITYivec2 ); 
    
write_byteTE_SPARKS ); 
    
write_coordivec2[0] ); 
    
write_coordivec2[1] ); 
    
write_coordivec2[2] ); 
    
message_end();
    
    
emit_sound0CHAN_ITEM"ambience/thunder_clap.wav"1.0ATTN_NORM0PITCH_NORM);
}

/*EmitSound( channel, sample[], Float:vol, Float:att,flags, pitch )
{
    new players[32], index, num, i;
    get_players( players, num, "c" );
    
    for( i = 0; i < num; i++ )
    {
        index = players[ i ];
        if( !is_user_connected( index ) )
            continue;
            
        emit_sound( index, channel, sample, vol, att, flags, pitch );
    }
} */

Fadeindexdurationholdtimeflagsredgreenbluealpha )
{
    
message_beginMSG_ONE_UNRELIABLEg_msgscreenfade, { 00}, index );
    
write_shortduration );
    
write_shortholdtime );
    
write_shortflags );
    
write_bytered );
    
write_bytegreen );
    
write_byteblue );
    
write_bytealpha );
    
message_end();
}

Iconindexmode=2, const sprite[], red=0green=255blue=)
{
    
message_beginMSG_ONEg_msgstatusicon, { 00}, index );
    
write_bytemode );
    
write_stringsprite ); 
    
write_bytered );
    
write_bytegreen ); 
    
write_byteblue );
    
message_end();
}

lights( const light[] ) return engfuncEngFunc_LightStyle0light ); 

Last edited by Romeo8; 09-22-2018 at 19:45. Reason: added php tags
Romeo8 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-22-2018 , 18:12   Re: native error (native "message_begin")
Reply With Quote #6

Use [php] tag when posting codes.
https://forums.alliedmods.net/showpo...81&postcount=9
__________________
edon1337 is offline
Romeo8
Junior Member
Join Date: Feb 2018
Old 09-22-2018 , 19:46   Re: native error (native "message_begin")
Reply With Quote #7

ummm im sorry i have no idea what you want me to do with that link

Last edited by Romeo8; 09-22-2018 at 19:47. Reason: wrong info
Romeo8 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-23-2018 , 07:14   Re: native error (native "message_begin")
Reply With Quote #8

Quote:
Originally Posted by Romeo8 View Post
im not a coder
Then why are you posting in the scripting help section???
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Romeo8
Junior Member
Join Date: Feb 2018
Old 09-23-2018 , 13:27   Re: native error (native "message_begin")
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
Then why are you posting in the scripting help section???
1. Because to my eye it is a scripting error (from an AlliedModders approved Plugin).
2. So why would I go go anywhere else for assistance.
Not being a coder if i was told that such and such in line ## needed to be changed to xyz I could do that. But to try to understand what the problem is is way above me.
3. And why would YOU, OciXCrom, flame someone new asking for help??
Romeo8 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-23-2018 , 13:39   Re: native error (native "message_begin")
Reply With Quote #10

Oh, now that I see it, you have to ask the plugin creator to fix his plugin, not us. Also, scripting help is a section made for scripters which need help on fixing their codes, if you want someone to do it for you, you have to post in Requests section.
__________________
edon1337 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 13:00.


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