Dispatching model and origin seem to work, but I can't get the thing to be solid or act like a func_door. I tried set_size, movetype fly, sold bbox and it sorta worked. When I touch it, it moves up and down about 1 unit really fast, even if it's in the middle of the air. Key value "speed" doesn't affect how fast it goes.
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")
register_clcmd("finddoor","doorfind")
}
public doorfind(id)
{
new door = find_ent_by_class(-1,"func_door")
client_print(0,print_chat,"Movetype - %i",entity_get_int(door,EV_INT_movetype))
client_print(0,print_chat,"Solid - %i",entity_get_int(door,EV_INT_solid))
}
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])
DispatchKeyValue(ent,"classname","func_door")
DispatchKeyValue(ent,"origin",szOrigin)
DispatchKeyValue(ent,"model","models/bhopbox.mdl")
//I got all the keyvalues from Hammer
DispatchKeyValue(ent,"rendercolor","0 0 0")
DispatchKeyValue(ent,"angles","90 0 0")
DispatchKeyValue(ent,"delay","0")
DispatchKeyValue(ent,"speed","100")
DispatchKeyValue(ent,"movesnd","0")
DispatchKeyValue(ent,"stopsnd","0")
DispatchKeyValue(ent,"wait","1")
DispatchKeyValue(ent,"lip","0")
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")
//movetype and solid are set to PUSH and BSP upon spawn automatically
DispatchSpawn(ent)
//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_FLY)
new Float:flOrigin[3]
IVecFVec(origin,flOrigin)
flOrigin[2] += 72.0
entity_set_origin(id,flOrigin)
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_model("models/bhopbox.mdl")
}