I have looked at other plugins, looked at the entity tutorial by Hawk552, but I don't understand why the code below does not work. As far as I know, this should create a player.mdl at the origin where the client's sight intersects with another ent or world.
The only output I get is the client_print(). I don't see any models.
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "Model"
#define VERSION "1.0"
#define AUTHOR "stupok69"
#define MODEL "models/player.mdl"
#define CLASSNAME "info_target"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("create", "create_function", ADMIN_BAN)
}
public plugin_precache()
{
precache_model(MODEL)
}
public create_function(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new origin[3]
get_user_origin(id, origin, 3)
client_print(id, print_chat, "Origin: %5i : %5i : %5i", origin[0], origin[1], origin[2])
new ent = create_entity(CLASSNAME)
entity_set_origin(ent, float:origin)
entity_set_model(ent, MODEL)
return PLUGIN_HANDLED
}