Raised This Month: $12 Target: $400
 3% 

Cycling through player views


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Python
Junior Member
Join Date: Dec 2006
Old 12-07-2006 , 09:20   Cycling through player views
Reply With Quote #1

I want to cycle through the players and see what they see, when Im in spectating mode. I know Im able to do this by pressing mouse1/mouse2, but I want to automatically do this @ respawn. It has to stop at a player which I choose in a menu, so I will see what he's seeing.

So basicly it has to do this:

1) Choose player from menu (piece of cake..)
2) Respawn: cycle through players (check..)
3) Stop @ choosen player (too easy..)
4) Let me see what choosen player is seeing and stick with him / spectate him (many attempts failed...)

I tried to do it with get_user_origin and setting this origin for the specator but this doesn't seem to work.
Python is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-07-2006 , 10:17   Re: Cycling through player views
Reply With Quote #2

You can use attach_view, "attach_view ( player, target ) "
The target can't be a player, so you will have to create an entity that follows the player you wish to spectate.
This is a my Proof of concept, and has not yet been tested, so try this out.

Code:
new camera[33] public FollowPlayer(id,id2){ new Float:origin[3]; entity_get_vector(id2,EV_VEC_origin,origin) ; new camera[id] = create_entity("info_target"); entity_set_string(camera[id],EV_SZ_classname,"spectatorcamera") ; entity_set_origin(camera[id],origin); entity_set_int(camera[id], EV_INT_movetype, MOVETYPE_FOLLOW ); //follow the player entity_set_edict(camera[id], EV_ent_aiment, id );  //set aim entity_set_edict(camera[id], EV_ent_owner,33); } Public Follow(id){ attach_view ( id, camera[id] ) }
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-07-2006 , 10:23   Re: Cycling through player views
Reply With Quote #3

excuse me:

Code:
Public Follow(id){
//you will have to find out yourself which player you want to follow(menu?) that should be id2
FollowPlayer(id,id2)

if (camera[id]){
attach_view ( id, camera[id] ) 
}else{
console_print(id,"I could NOT attach you to the player")
}
}
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.

Last edited by dutchmeat; 12-07-2006 at 10:28.
dutchmeat is offline
Python
Junior Member
Join Date: Dec 2006
Old 12-07-2006 , 10:31   Re: Cycling through player views
Reply With Quote #4

Ok thnx!

Btw what includes do I need?
Python is offline
watch
Senior Member
Join Date: Sep 2005
Old 12-07-2006 , 10:31   Re: Cycling through player views
Reply With Quote #5

Why do you use semicolon, whitespace and case inconsistantly ;)?

You would also have to do a bit more than set the origin, angles etc :>
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 12-07-2006 at 10:36.
watch is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-07-2006 , 10:36   Re: Cycling through player views
Reply With Quote #6

well i'll test it when i get home then
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Python
Junior Member
Join Date: Dec 2006
Old 12-07-2006 , 10:38   Re: Cycling through player views
Reply With Quote #7

Watch do you know a piece of code that will work and has been tested?
Python 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 20:39.


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