I did as you said and still not work
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
new Entity
new const DATE[] = "models/TEST.mdl"
new maxplayers
public plugin_init()
{
register_clcmd("say /x", "remove")
register_clcmd("say /z", "create")
maxplayers = get_maxplayers()
}
public remove()
{
new ent = -1;
while ((ent = find_ent_by_class(ent, "fox_wall")))
{
remove_entity(ent);
}
}
public create()
{
CreateEntity()
}
public plugin_precache()
{
precache_model(DATE)
CreateEntity()
}
CreateEntity()
{
Entity = create_entity( "info_target" );
new Float:PlayerOrigin[3]
new Float:fDistance
new Float:fEntOrigin[ 3 ]
for(new i = 1 ; i <= maxplayers; i++)
{
pev(i, pev_origin, PlayerOrigin)
pev( Entity , pev_origin , fEntOrigin )
fDistance = get_distance_f( fEntOrigin , PlayerOrigin )
if( fDistance >= 500.0)
{
client_print(i , print_center, "Distance to entity: %.2f", fDistance )
}
}
if( is_valid_ent(Entity) )
{
entity_set_string( Entity , EV_SZ_classname, "fox_wall");
entity_set_int( Entity , EV_INT_solid, SOLID_BBOX);
entity_set_model( Entity , DATE );
entity_set_size( Entity , Float:{ -350.0, -10.0, 0.0 }, Float:{ 350.0, 10.0, 10.0 } );
entity_set_origin( Entity, Float:{ 1066.52, -1025.00, -551.00 } );
}
return;
}