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

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


Post New Thread Reply   
 
Thread Tools Display Modes
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-23-2020 , 23:25   Re: FATAL ERROR (shutting down): Hit a dm_item with no model
Reply With Quote #11

Quote:
Originally Posted by DJEarthQuake View Post
Code:
public plugin_precache()    g_breath = precache_model("sprites/steam1.spr");
Code:
new const TEST_MODEL[] = "models/test.mdl" public plugin_precache() {     if (file_exists(TEST_MODEL))         precache_model(TEST_MODEL);

Quote:
Originally Posted by bLacK-bLooD View Post
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)
░░░░░░░░░░░░▄▐
░░░░░░▄▄▄░░▄██▄
░░░░░▐▀█▀▌░░░░▀█▄
░░░░░▐█▄█▌░░░░░░▀█▄
░░░░░░▀▄▀░░░▄▄▄▄▄▀▀
░░░░▄▄▄██▀▀▀▀
░░░█▀▄▄▄█▀▀
░░░▄▄▄▐▌▀▀▀
░░░▄▄▀▀
▀█▌░░░▀█▀
░░░░░░░▄▄▐▌▄▄
░░░░░░░▀███▀█
░░░░░░▐▌▀▄▀▄▀▐▄
░░░░░░▐▀░░░░░░▐▌
░░░░░░░░░░░░░░
░░░░░▐▌░░░░░░░░░
░░░░░░░░░░░░░░░▐▌
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 const TEST_MODEL[] = "models/test.mdl"

public plugin_precache()
{
    if (
file_exists(TEST_MODEL))
        
precache_model(TEST_MODEL);

    else

        {
            
log_amx("Model, ^"%s^", was not found!"TEST_MODEL);
            
pause "a";
        }
}

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,entTEST_MODEL)
   
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)

__________________

Last edited by DJEarthQuake; 12-23-2020 at 23:44.
DJEarthQuake 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 18:35.


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