PHP Code:
stock zn_cameramode( id, status )
{
if( status )
{
if( !is_valid_ent(zn_cament[id]) )
{
static Float:o[3]
pev( id, pev_origin, o )
zn_cament[id] = create_entity("info_target")
set_pev( zn_cament[id], pev_classname, "camera" )
cfg_string(cfg_animations, 0, temp2, 63 )
format( temp1, 100, "models/player/%s/%s.mdl", temp2, temp2 )
if(zn_animmdl_index_b) set_pev( zn_cament[id], pev_body, zn_int( zn_animmdl_index_b, 0 ) )
entity_set_model(zn_cament[id], temp1)
dllfunc(DLLFunc_Spawn, zn_cament[id])
set_pev(zn_cament[id], pev_solid, SOLID_NOT)
set_pev(zn_cament[id], pev_movetype, MOVETYPE_FOLLOW)
entity_set_origin(zn_cament[id], o)
entity_set_size(zn_cament[id], Float:{ -3.0, -3.0, -3.0 }, Float:{ 3.0, 3.0, 3.0 } )
set_pev( zn_cament[id], pev_team, 159 )
attach_view(id, zn_cament[id])
set_pev( zn_cament[id], pev_nextthink, get_gametime() + 0.01 )
set_pev( zn_cament[id], pev_owner, id )
}
}
else
{
attach_view(id, id)
if(is_valid_ent(zn_cament[id])) remove_entity(zn_cament[id])
zn_cament[id] = 0
}
}
public zn_camthink(ent)
{
if( !is_valid_ent(ent) ) return HAM_IGNORED
static id
id = pev( ent, pev_owner )
if( pev( ent, pev_team ) != 159 ) return HAM_IGNORED
if( !is_user_connected(id) )
{
remove_entity(ent)
zn_cament[id] = 0
return HAM_SUPERCEDE
}
static Float:o[3], Float:o2[3], Float:a[3]
pev( id, pev_origin, o )
pev( id, pev_v_angle, a )
a[1] += 180.0
if( a[1] > 360.0 ) a[1] -= 360.0
a[0] *= -1.0
zn_velocity_by_angle( a, 100.0, o2)
o2[0] += o[0]
o2[1] += o[1]
o2[2] += o[2]
engfunc( EngFunc_TraceLine, o, o2, IGNORE_MONSTERS, 0, 0 );
// engfunc(EngFunc_TraceHull, o, o, DONT_IGNORE_MONSTERS, HULL_HEAD, 0, 0)
get_tr2( 0, TR_vecEndPos, o )
// o[0] -= o2[0] * 0.95
// o[1] -= o2[1] * 0.95
// o[2] -= o2[2] * 0.95
set_pev( ent, pev_origin, o )
pev( id, pev_v_angle, a )
set_pev( ent, pev_angles, a )
// set_pev( id, pev_angles, Float:{0.0, 0.0, 0.0} )
set_pev( ent, pev_nextthink, get_gametime() + 0.01 )
return HAM_IGNORED
}
stock zn_velocity_by_angle( Float:a[3], Float:b, Float:c[3])
{
static Float:d
engfunc(EngFunc_MakeVectors, a)
global_get(glb_v_forward, c)
d = vector_length(c)
c[0] *= (b / d); c[1] *= (b / d); c[2] *= (b / d)
}
It is doing same thing on de_dust2 if you think that the map is the problem here.