Raised This Month: $ Target: $400
 0% 

Camera Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
padilha007
Senior Member
Join Date: Jul 2008
Old 04-25-2011 , 03:18   Camera Problem
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>

new const pl_cm_class[] = "PlayerCamera"
new g_iPlayerCamera[33]

public 
plugin_init()
{
    
register_think(pl_cm_class,"Think_PlayerCamera")
}

Create_PlayerCamera(id)
{
    static 
iEntiEnt g_iPlayerCamera[id];
    
    if ( 
pev_valid(iEnt) )
    {
        
engfunc(EngFunc_SetViewidiEnt);
    }
    else
    {
        static 
ent ent g_iPlayerCamera[id] = create_entity("info_target")
        
        if( !
ent )
            return;
        
        
entity_set_string(entEV_SZ_classnamepl_cm_class)
        
        
entity_set_model(ent"models/w_usp.mdl")
        
        
entity_set_byte(entEV_INT_solidSOLID_TRIGGER)
        
entity_set_int(entEV_INT_movetypeMOVETYPE_FLYMISSILE)
        
        
entity_set_edict(entEV_ENT_ownerid)
        
        
entity_set_int(ent,EV_INT_rendermodekRenderTransTexture)
        
entity_set_float(entEV_FL_renderamt0.0 )
        
        
attach_view(id,ent)
        
entity_set_float(entEV_FL_nextthinkget_gametime())
    }
}

public 
Think_PlayerCamera(ent)
{
    static 
owner
    owner 
entity_get_edict(ent,EV_ENT_owner)
    
    static 
Float:origin[3], Float:fAngle[3],Float:origin2[3];
    
entity_get_vector(owner,EV_VEC_v_angle,fAngle);
    
entity_get_vector(owner,EV_VEC_origin,origin);
    
    
origin2[0] = origin[0];
    
origin2[1] = origin[1];
    
origin2[2] = origin[2];
    
    static 
Float:fVBack[3];
    
angle_vectorfAngleANGLEVECTOR_FORWARDfVBack );
    
    
origin[2] += 35.0;
    
    
origin[0] += ( -fVBack[0] * 150.0 );
    
origin[1] += ( -fVBack[1] * 150.0 );
    
origin[2] += ( -fVBack[2] * 150.0 );
    
    
trace_line(ownerorigin2originorigin);
    
    
entity_set_vector(ent,EV_VEC_origin,origin)
    
    
entity_get_vector(owner,EV_VEC_velocity,origin2)
    
entity_set_vector(ent,EV_VEC_velocity,origin2)
    
    
entity_set_vector(ent,EV_VEC_angles,fAngle)
    
entity_set_float(entEV_FL_nextthinkget_gametime())
    
    return 
PLUGIN_CONTINUE

Image:
http://img220.**************/i/errordo.png/

My problem is that when the wall while the camera can see the other players. There is a possibility to fix this?
__________________

padilha007 is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-25-2011 , 07:43   Re: Camera Problem
Reply With Quote #2

1) Grabbing someone's else code just like that is bad.
2) Ask author.
__________________

SonicSonedit is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode