Raised This Month: $ Target: $400
 0% 

Origin 0,0,0 ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-13-2005 , 20:37   Origin 0,0,0 ???
Reply With Quote #1

This will always spawn the entity at the origin 0,0,0 no matter where i point

Code:
public place_camera(id) {         if( get_cvar_num("sv_camera") < 1 ) {                 client_print(id, print_chat, "[CAMERA] Camera MOD is disabled at this time!" )                 return PLUGIN_HANDLED             }         if( hasPlacedCamera[id] ) {                 client_print(id, print_chat, "[CAMERA] You already Placed a Camera! ")                 return PLUGIN_HANDLED     }         new camera = create_entity("info_target")     new origin[3]         // Logging         new name[32]     new authid[32]         get_user_name(id, name, 31)     get_user_authid(id, name, 31)         log_amx("<%s><><%s><> Set a Camera !", name, authid)         //---------------------         new Float:forigin[3]         get_user_origin(id, origin, 3)     IVecFVec(origin, forigin)         entity_set_vector(camera,EV_VEC_origin,  forigin)         new Float:maxs[3] = {1.0,1.0,3.0}     new Float:mins[3] = {-1.0,1.0,-3.0}         entity_set_size(camera,mins,maxs)     entity_set_int(camera,EV_INT_solid, SOLID_NOT )         entity_set_string(camera, EV_SZ_classname, "camera" )         entity_set_float(camera,EV_FL_takedamage,1.0)     entity_set_float(camera,EV_FL_health,100.0) // prehaps some try bullets or a nade     // will fly by ?         entity_set_edict(camera, EV_ENT_owner, id)         hasPlacedCamera[id] = true             return PLUGIN_CONTINUE     }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-13-2005 , 21:31  
Reply With Quote #2

My guess is that if you used client_print to display forigin it would be correctly placed, it's just that when you use attach_view on the camera your view appears as if the camera is at 0,0,0, which I cannot solve.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-13-2005 , 22:26  
Reply With Quote #3

Why would the view be there, when the camera is way over somewhere else ?
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-13-2005 , 23:30  
Reply With Quote #4

If only I knew, all of my cameras are broken like that as well.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Ingram
Veteran Member
Join Date: May 2004
Old 10-14-2005 , 00:08  
Reply With Quote #5

entity_set_origin, this might only work after the ent is spawned
Ingram is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-14-2005 , 10:35  
Reply With Quote #6

The entity is already spawned when i declare this


Code:
 new camera = create_entity("info_target")
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
leakgfhp
Member
Join Date: Apr 2005
Old 10-14-2005 , 10:46  
Reply With Quote #7

and this?
Code:
DispatchSpawn(camera)
leakgfhp is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-14-2005 , 10:58  
Reply With Quote #8

Never really had to use that, tried, but did the exact same thing just as if i didnt call it.


But will try, even though i highly doubt it will effect anything.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-14-2005 , 12:38  
Reply With Quote #9

Nope, didnt change a thing.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Ingram
Veteran Member
Join Date: May 2004
Old 10-14-2005 , 13:11  
Reply With Quote #10

Quote:
Originally Posted by leakgfhp
and this?
Code:
DispatchSpawn(camera)
hes right, it doesn't spawn until you use that function
Ingram 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 00:03.


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