AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   "Caching" the user who is spectating (https://forums.alliedmods.net/showthread.php?t=204724)

meTaLiCroSS 01-02-2013 19:19

"Caching" the user who is spectating
 
There exists an acceptable way for caching the current user's spectated player? Maybe hooking some Observer_* functions from Orpheu, which I don't know how to hook o.O or any other way, for using it on a AddToFullPack forward tu reduce the usage of it, don't know if I explained correctly what I want

fysiks 01-02-2013 20:19

Re: "Caching" the user who is spectating
 
Quote:

Originally Posted by meTaLiCroSS (Post 1865739)
There exists an acceptable way for caching the current user's spectated player? Maybe hooking some Observer_* functions from Orpheu, which I don't know how to hook o.O or any other way, for using it on a AddToFullPack forward tu reduce the usage of it, don't know if I explained correctly what I want

What are you trying to do? I know there is a way to get the spectated player via fakemeta. It's been posted on the forums several times.

meTaLiCroSS 01-02-2013 20:25

Re: "Caching" the user who is spectating
 
Quote:

Originally Posted by fysiks (Post 1865785)
What are you trying to do? I know there is a way to get the spectated player via fakemeta. It's been posted on the forums several times.

Yeah, through 2 entvars

PHP Code:

const EV_INT_SPEC_MODE =     EV_INT_iuser1 // just for readability
const EV_INT_SPEC_TARGET EV_INT_iuser2 

But is a bad idea to call these entvars on AddToFullPack constantly.

Take as an example this plugin: https://forums.alliedmods.net/showthread.php?t=159584

You can show an sprite just to one player, and it tries to have always in player's screen

Well, I want to show an sprite to a player, BUT ALSO show to any spectator which watches him on First Person View

So that's why I'm asking for a way for caching spectator's target, any other doubt?

fysiks 01-02-2013 20:44

Re: "Caching" the user who is spectating
 
I guess I don't really understand you question then. It should be obvious. You store the value in a variable . . . and then use the variable . . . aka caching. You just need to update it appropriately.

meTaLiCroSS 01-02-2013 21:12

Re: "Caching" the user who is spectating
 
Quote:

Originally Posted by fysiks (Post 1865807)
You just need to update it appropriately.

That's what I'm asking LOL, asking which forward, event, or something, for storing the value appropriately


All times are GMT -4. The time now is 13:38.

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