I dont know y the hostage is spawned above the ground not on the ground.........it is spawning at the height of my character's neck.....
I have calculated the origins from teleport plugin .....
Please help!!!!
PHP Code:
#include <amxmodx>
#include <engine>
public plugin_init() {
register_plugin("Hostage Spawner", "1.0", "NONE")
register_concmd("hostage", "host_spawn")
}
public plugin_precache() {
precache_model("models/hostage.mdl")
precache_sound("hostage/hos1.wav")
}
public host_spawn(id) {
new Float:origin[3] = { -2687.0, 574.0, -1962.0 }
new host = create_entity("hostage_entity")
if( is_valid_ent( host ) )
{
entity_set_float(host,EV_FL_takedamage,1.0)
entity_set_float(host,EV_FL_health,100.0)
entity_set_string(host,EV_SZ_classname,"hostage_entity");
entity_set_model(host,"models/hostage.mdl");
entity_set_int(host,EV_INT_solid, 2)
/*entity_set_byte(host,EV_BYTE_controller1,125);
entity_set_byte(host,EV_BYTE_controller2,125);
entity_set_byte(host,EV_BYTE_controller3,125);
entity_set_byte(host,EV_BYTE_controller4,125);
*/
new Float:maxs[3] = {16.0,16.0,36.0}
new Float:mins[3] = {-16.0,-16.0,-36.0}
entity_set_size(host,mins,maxs)
/*entity_set_float(host,EV_FL_animtime,2.0)
entity_set_float(host,EV_FL_framerate,1.0)
entity_set_int(host,EV_INT_sequence,0);
*/
entity_set_float(host,EV_FL_nextthink,halflife_time() + 0.01)
entity_set_origin(host,origin)
//drop_to_floor(host)
return 1
}
return 0
}