Im trying to make a plugin that adds a trail of individual animated smoke poofs. But here's the problem, find_ent_by_class only returns 1 entity match per execution and fm_find_ent_by_class doesn't work worth a damn. I also can't multi-task origins in the same code execution. Everything has to be able to handle multiple indexes at the same time to work the way I want it. But as it is now, it can only handle 1 rocket at a time.
For loop doesn't do any good. It just loops over the same entity if there's only 1 causing redundant sprite overlapping.
PHP Code:
new Ent[33]
new Float:Origin[3]
new iOrigin[3]
public RocketTrail(id)
{
Ent[id] = find_ent_by_class(-1, "tf_rpg_rocket")
//fm_find_ent_by_class(Ent, "tf_rpg_rocket")
//get_user_origin(id, Origin)
entity_get_vector(Ent[id], EV_VEC_origin,Origin);
//Origin = pev(Ent,pev_origin)
iOrigin[0] = floatround(Origin[0])
iOrigin[1] = floatround(Origin[1])
iOrigin[2] = floatround(Origin[2])
client_print(id,print_chat, "Entity: %d (%d)",Ent, iOrigin[0])
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(17);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(DustSpr)
write_byte(0.5);
write_byte(250);
message_end();
Here's the problem trying to have multiple origin indexs at the same time.
PHP Code:
new Ent[33]
new Float:Origin[3][33]
new iOrigin[3][33]
public RocketTrail(id)
{
Ent[id] = find_ent_by_class(-1, "tf_rpg_rocket")
//fm_find_ent_by_class(Ent, "tf_rpg_rocket")
entity_get_vector(Ent[id], EV_VEC_origin,Origin[id]); // This line here it won't allow multi-origin array. Origin[id] gets a compiler error because the [id] is interpreted as part of the x,y,z array yet cant have Origin[0][id] either. This has run me into a dead end for multi-origin indexing.
//Origin = pev(Ent,pev_origin)
iOrigin[0][id] = floatround(Origin[0][id])
iOrigin[1][id] = floatround(Origin[1][id])
iOrigin[2][id] = floatround(Origin[2][id])
client_print(id,print_chat, "Entity: %d (%d)",Ent, iOrigin[0][id])
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(17);
write_coord(iOrigin[0][id]);
write_coord(iOrigin[1][id]);
write_coord(iOrigin[2][id]);
write_short(DustSpr)
write_byte(0.5);
write_byte(250);
message_end();
__________________