Raised This Month: $ Target: $400
 0% 

Ent flying x units over player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-20-2007 , 17:02   Re: Ent flying x units over player
Reply With Quote #1

Code:
new myCamera[33]; public plugin_init() {      register_forward(FM_PlayerPostThink,"fw_postthink"); } public make_a_camera(id) {      myCamera[id] = create_entity("info_target"); } public fw_postthink(id) {      if(pev_valid(myCamera[id]))      {           new Float:origin[3];           pev(id,pev_origin,origin);           origin[2] += 128.0; // or however many units           set_pev(myCamera[id],pev_origin,origin);      } }

After updating your position, it finds the space 128 units above you, and sets your camera's origin to that. If you want to make sure it doesn't go through the roof, you'll want to do a trace line upwards and see if it hits anything before 128 units.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
osk522
BANNED
Join Date: Dec 2006
Location: Slöinge, Falkenberg, Hal
Old 01-20-2007 , 18:45   Re: Ent flying x units over player
Reply With Quote #2

Quote:
Originally Posted by XxAvalanchexX View Post
After updating your position, it finds the space 128 units above you, and sets your camera's origin to that. If you want to make sure it doesn't go through the roof, you'll want to do a trace line upwards and see if it hits anything before 128 units.
Haven't tested it, but it looks so simple it just got to work .
+karma.
osk522 is offline
Send a message via MSN to osk522
osk522
BANNED
Join Date: Dec 2006
Location: Slöinge, Falkenberg, Hal
Old 01-20-2007 , 21:10   Re: Ent flying x units over player
Reply With Quote #3

Tested it, although I dont know if it works.
When I do attach_view(id,cameraent[id]) the display fucks up.
When I shoot, I can hear the sounds of the gun.
I think it's becouse the ent doesn't have any angles, how do I fix it?
osk522 is offline
Send a message via MSN to osk522
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 22:22.


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