1. How can I make that entity I spawn, and I give him a model, it plays a animation as long as it exists in world?
2. How to make that when someone touches you, it is automatically killed
NOTE I have entity spawned on player, so it is probably easier to make when some1 touches that entity it dies?
Could you show me an example to create a entity, which follows player and has some model, and when some1 touches it it dies?
Please show it on this piece of code below ( you need to add when touches that entity the player who touched it dies, and to make it follows you ( but not gets your animations, just stays idle ).
Code:
new ModelKillEnt[33]
public NewEnt(id)
{
ModelKillEnt[id] = create_entity(env_model)
entity_set_model(ModelKillEnt[id], "miscstuff/entitykiller.mdl") // it is precached later, just not here in snippet
// do the follow stuff here
// and do the kill stuff somewhere in code
return PLUGIN_HANDLED
}
__________________