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

FATAL ERROR (shutting down): Hit a dm_item with no model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 10-21-2016 , 06:34   FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #1

Hi, I am using a plugin and my server shuts down when I get near a model that gets spawned by that plugin with this error:

Code:
FATAL ERROR (shutting down): Hit a dm_item with no model (models/my_test_model.mdl)
The model is not faulty, since I tried using 3 different models, and the same error is thrown.

EDIT: I have backtraced the issue and apparently it occurs when round_start() function is run.

FULL CODE:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <engine>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""

new const item_class_name[] = "dm_item"

new g_models[] = "models/test.mdl"

public plugin_precache()
{
   
precache_model(g_models)   
}

public 
plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR)
   
   
register_forward(FM_Touch"fwd_Touch")
   
   
register_event("HLTV""round_start""a""1=0""2=0")
   
   
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
   
   
}

public 
fwd_Touch(touchertouched)
{
   if (!
is_user_alive(toucher) || !pev_valid(touched))
      return 
FMRES_IGNORED
   
   
new classname[32]   
   
pev(touchedpev_classnameclassname31)
   if (!
equal(classnameitem_class_name))
      return 
FMRES_IGNORED

   give_item
(toucher)
   
set_pev(touchedpev(touchedpev_effects ) | EF_NODRAW)
   
set_pev(touchedpev_solidSOLID_NOT)
   
   return 
FMRES_IGNORED
   
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
   if (!
is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim || !attacker)
      return 
HAM_IGNORED

   
new origin[3]
   
get_user_origin(victimorigin0)
      
   
addItem(origin)
   
   return 
HAM_IGNORED
}

public 
addItem(origin[3])
{
   new 
ent fm_create_entity("info_target")
   new 
Float:mins[3] = {-10.0, -10.00.0}, Float:maxs[3] = {10.010.025.0}
   
   
set_pev(entpev_classnameitem_class_name)
   
   
engfunc(EngFunc_SetModel,entg_models)
   
engfunc(EngFunc_SetSizeentminsmaxs);

   
set_pev(ent,pev_solid,SOLID_BSP)
   
set_pev(ent,pev_movetype,MOVETYPE_PUSHSTEP)
   
   new 
Float:fOrigin[3]
   
IVecFVec(originfOrigin)
   
set_pev(entpev_originfOrigin)
   
   
set_pev(ent,pev_renderfx,kRenderFxGlowShell)

   switch(
random_num(1,2))
   {
      case 
1set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0})
      case 
2set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0})
   }
}

public 
give_item(id)
{
    switch (
random_num(0,1)){ 
        case 
0:{
            new 
HP;
            
HP 50;   
            
fm_set_user_health(idget_user_health(id) + HP); 
         }

        case 
1:{
            
fm_give_item(id,"weapon_hegrenade")
        }
    }
}

public 
round_start()
{
   new 
ent FM_NULLENT
   
static string_class[] = "classname"
   
while ((ent engfunc(EngFunc_FindEntityByStringentstring_classitem_class_name))) 
      
set_pev(entpev_flagspev(entpev_flags) | FL_KILLME)

__________________
We all live under the same sky but we have different horizons.

Last edited by bLacK-bLooD; 12-12-2017 at 04:11. Reason: added full code
bLacK-bLooD is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 10-21-2016 , 10:00   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #2

I now realised I did not provide enough code so the developers can understand the code.

Moderators: Can I repost the thread with all the information so devs can take a look again at the full code?
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-09-2017 , 07:20   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #3

BUMP`
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-09-2017 , 12:46   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #4

Try to 'spawn' the entity after create, like this:
PHP Code:
    new ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringclassname))
    if(
ent) {
        
set_pev(entpev_originorigin)    
        
dllfunc(DLLFunc_Spawnent// here
    
}
    return 
ent 
Your way to set flags is wrong. With your way you overide all flags.
Must be:
PHP Code:
set_pev(entpev_flagspev(entpev_flags) | FL_KILLME// add flag 
The same is valid for pev_effects.
__________________
My English is A0

Last edited by E1_531G; 12-09-2017 at 12:51.
E1_531G is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-11-2017 , 05:08   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #5

Quote:
Originally Posted by E1_531G View Post
Try to 'spawn' the entity after create, like this:
PHP Code:
    new ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringclassname))
    if(
ent) {
        
set_pev(entpev_originorigin)    
        
dllfunc(DLLFunc_Spawnent// here
    
}
    return 
ent 
Your way to set flags is wrong. With your way you overide all flags.
Must be:
PHP Code:
set_pev(entpev_flagspev(entpev_flags) | FL_KILLME// add flag 
The same is valid for pev_effects.
I can't spawn it when I create it because I want to spawn it on death on top of the dead body.

I added the full code to the first post. I fixed the flags problem.

I still can't find a solution
__________________
We all live under the same sky but we have different horizons.

Last edited by bLacK-bLooD; 12-11-2017 at 05:13.
bLacK-bLooD is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-11-2017 , 05:30   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #6

Quote:
Originally Posted by bLacK-bLooD View Post
I can't spawn it when I create it because I want to spawn it on death on top of the dead body.

I added the full code to the first post. I fixed the flags problem.

I still can't find a solution
How about just using one method to set the entity size
__________________
@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
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-11-2017 , 06:44   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
How about just using one method to set the entity size
Oops, fixed.
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-11-2017 , 17:15   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #8

Quote:
Originally Posted by bLacK-bLooD View Post
Oops, fixed.
You do realize that size is the same as maxs and mins
So its not fixed yet.
__________________
@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
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-12-2017 , 04:11   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #9

Quote:
Originally Posted by Natsheh View Post
You do realize that size is the same as maxs and mins
So its not fixed yet.
Is it ok now?
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-23-2020 , 06:20   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #10

bump
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
Reply


Thread Tools
Display Modes

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:07.


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