Right now i have a admin menu button activate a keypress event. example keyp 7 for client #7. Then in keypress handler I make sure local.player is an admin. If so, then I basically exec this:
local.admin is the admin who wants to watch a player
local.player is the player being watched
PHP Code:
while(blah blah blah) //checking for spectate & other things
{
local.inradius = vector_within local.admin.origin local.player.origin 130
waitframe
while(!local.inradius)
{
//blah blah blah....do some more checks to exit loop.
local.admin stufftext "+use;-use" // pressing use will go to next player in spectate.
wait .3 // seems if I wait less, then sometimes the player can be skipped over cause it cycles thru too fast
local.inradius = vector_within local.admin.origin local.player.origin 130
}
}
Basically what I wish it would do, is stay with that player the whole time.
I've tried going this route too to follow a player...
PHP Code:
local.origin = local.admin.origin
local.viewangles = local.admin.viewangles
local.admin nodamage
local.admin hide
local.admin notsolid
local.admin noclip
while(blah blah)
{
local.admin.origin = local.player.origin - local.player.forwardvector * 56 //distance back
local.admin.origin += ( 0 0 24 ) //dist up
}
Problem with that is, that it is jumpy, and very annoying.