I've never done this before, but I'm trying to create an entity where the player is aiming and give it a model. Right now all I'm seeing is the implode effect. I feel like I'm missing something really basic...
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "Radioactive Waste"
#define AUTHOR "Harman"
#define VERSION "1.0"
new isotopeModel[] = "models/chromegibs.mdl"
new aimVector[3]
public plugin_precache()
{
precache_model(isotopeModel)
}
public plugin_init()
{
register_plugin(PLUGIN, AUTHOR, VERSION)
register_clcmd("waste", "radiate")
}
public radiate(id)
{
new isotopeEnt = create_entity("info_target")
entity_set_string(isotopeEnt,EV_SZ_classname,"isotope")
get_user_origin(id, aimVector, 3) //where the player is aiming
entity_set_origin(isotopeEnt, aimVector)
entity_set_model(isotopeEnt, isotopeModel)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY) //implosion effect
write_byte(TE_IMPLOSION)
write_coord(aimVector[0])
write_coord(aimVector[1])
write_coord(aimVector[2])
write_byte(100) //radius
write_byte(50) //count
write_byte(25) //lifetime
message_end()
client_print(id, print_chat, "Test")
return PLUGIN_HANDLED
}