hi i m trying to create a hostage wiht this code but it crashed the server wiht no errors:
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
new HostageEntity[] = "hostage_entity"
public plugin_precache()
{
precache_model("models/hostage.mdl"),
precache_model("models/scientist.mdl")
}
public plugin_init()
{
register_clcmd("say /create","create_hostage")
}
public create_hostage(id)
{
new origin[3], Float:hostage_origin[3]
get_user_origin(id, origin, 3)
IVecFVec(origin, hostage_origin)
new hostage_ent = create_entity(HostageEntity)
if(hostage_ent > 0)
{
DispatchKeyValue(hostage_ent, "model", "models/hostage.mdl")
DispatchSpawn(hostage_ent)
entity_set_edict(hostage_ent, EV_ENT_owner, 33)
hostage_origin[2] += 2
entity_set_origin(hostage_ent, hostage_origin)
client_print(id, print_chat, "[AMXX] You have created hostage.")
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
__________________