Raised This Month: $ Target: $400
 0% 

attach_view error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Des12
Senior Member
Join Date: Jan 2005
Old 04-14-2006 , 17:32   attach_view error
Reply With Quote #1

The problem is, the camera always spawns at 0,0,0. I have looked at many different threads where people have had this problem, but no solution was ever found. So I hope this might be different:

Code:
       get_user_aiming(id, entid, entbody, 9999);     if(!is_user_alive(entid)) {         return PLUGIN_HANDLED;     }         g_victim[id] = entid;         new camera = create_entity("info_target")     new Float:origin[3]         entity_get_vector(entid, EV_VEC_origin, origin);         entity_set_origin(camera, origin)     new Float:maxs[3] = {0.0,0.0,0.0}     new Float:mins[3] = {0.0,0.0,0.0}         entity_set_size(camera,mins,maxs)     entity_set_int(camera, EV_INT_movetype, MOVETYPE_FOLLOW)         entity_set_int(camera, EV_INT_solid, SOLID_NOT)         entity_set_edict(camera, EV_ENT_aiment, entid)         entity_set_string(camera, EV_SZ_classname, "camera" )         DispatchSpawn(camera)           g_pcamera[id] = camera;     attach_view(id, g_pcamera[id])     set_task(0.1,"angles",id);     return PLUGIN_HANDLED; } public angles(id) {     if(g_victim[id] == 0) return PLUGIN_HANDLED;     new Float:angles[3];     entity_get_vector(g_victim[id], EV_VEC_angles, angles)     entity_set_vector(g_pcamera[id], EV_VEC_angles, angles)     set_task(0.1,"angles",id);     return PLUGIN_HANDLED; }

I make the camera, set it on the target's origin, set it to follow the target, make the player see through the camera, then cosntantly update the camera's angels to match the targets.

Neither the origin setting nor angle update works, but the player can see through the camera at 0,0,0.
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
 



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 05:12.


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