It all works fine, except when I jump onto it. I can touch it and it goes down like I want it, but when I jump onto it, it gives fatal error "Hit func_door with no model (models/bhopbox.mdl)"
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "bhop box maker"
#define VERSION "0.1"
#define AUTHOR "FatalisDK"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /bhopbox","bhop")
}
public bhop(id)
{
new ent = create_entity("func_door")
if (!is_valid_ent(ent)) return PLUGIN_HANDLED
new origin[3]
get_user_origin(id,origin)
new szOrigin[45]
format(szOrigin,44,"%i %i %i",origin[0],origin[1],origin[2] - 5)
DispatchKeyValue(ent,"origin",szOrigin)
DispatchKeyValue(ent,"model","models/bhopbox.mdl")
DispatchKeyValue(ent,"rendercolor","0 0 0")
DispatchKeyValue(ent,"angles","-90 0 0")
DispatchKeyValue(ent,"delay","0")
DispatchKeyValue(ent,"speed","150")
DispatchKeyValue(ent,"movesnd","0")
DispatchKeyValue(ent,"stopsnd","0")
DispatchKeyValue(ent,"wait","1")
DispatchKeyValue(ent,"lip","64")
DispatchKeyValue(ent,"dmg","0")
DispatchKeyValue(ent,"health","0")
DispatchKeyValue(ent,"locked_sound","0")
DispatchKeyValue(ent,"unlocked_sound","0")
DispatchKeyValue(ent,"locked_sentence","0")
DispatchKeyValue(ent,"unlocked_sentence","0")
DispatchKeyValue(ent,"renderfx","0")
DispatchKeyValue(ent,"rendermode","0")
DispatchKeyValue(ent,"renderamt","0")
DispatchSpawn(ent)
//entity_set_model(ent,"models/bhopbox.mdl")
entity_set_size(ent,Float:{-32.0,-32.0,-32.0},Float:{32.0,32.0,32.0})
entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
entity_set_int(ent,EV_INT_movetype,MOVETYPE_PUSH)
new Float:flOrigin[3]
IVecFVec(origin,flOrigin)
flOrigin[1] += 72.0
entity_set_origin(id,flOrigin)
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_model("models/bhopbox.mdl")
}