request_method

New Member
Messages
4
Reaction score
1
Points
3
Does anyone have an idea on how to check if I'm spectating a certian player? I'm pretty sure there exists a function called IsSpectating. And let's say I want to check if I'm spectating the player with the gamertag "CabCon". How would I do that?
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
Does anyone have an idea on how to check if I'm spectating a certian player? I'm pretty sure there exists a function called IsSpectating. And let's say I want to check if I'm spectating the player with the gamertag "CabCon". How would I do that?
Good question, I will take a look into it when I got home. :smile: This should be possible. :peace:
 

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
Code:
if(IsSpectating(player GetLocalClientNumber(), true)) //dont know if it checks if YOU are spectating the player

//or

if(self IsSpectating(player GetLocalClientNumber(), true)) //IsSpectating(<localClientNum>,[checkFistPerson]) - idk if checkFistPerson should be true or false
I don't know if any of these work, but I'm sure CabCon can help you with this
 

JayCoder

Veteran
Staff member
Messages
375
Reaction score
148
Points
903
Code:
if(IsSpectating(player GetLocalClientNumber(), true)) //dont know if it checks if YOU are spectating the player

//or

if(self IsSpectating(player GetLocalClientNumber(), true)) //IsSpectating(<localClientNum>,[checkFistPerson]) - idk if checkFistPerson should be true or false
I don't know if any of these work, but I'm sure CabCon can help you with this

its grabbing local client and if it true so i think u would go about that like this>>>

function PISM()
{
if(IsSpectating(player GetLocalClientNumber(), true))
{
iPrintln("This Player Is Spectaing ^2>>", IsSpectating(player GetLocalClientNumber));
}
}//That what i get from the first one u posted

the first one i think is looking for first dead spectator

but u could also just download the spectator file and see
 

Attachments

  • _spectating.gsc
    4.8 KB · Views: 314
Last edited:

Cxwh

Veteran
Messages
64
Reaction score
45
Points
793
its grabbing local client and if it true so i think u would go about that like this>>>

function PISM()
{
if(IsSpectating(player GetLocalClientNumber(), true))
{
iPrintln("This Player Is Spectaing ^2>>", IsSpectating(player GetLocalClientNumber));
}
}//That what i get from the first one u posted

the first one i think is looking for first dead spectator

but u could also just download the spectator file and see
Yeah I know what you mean, but it's not what he wants. He wants to know how to check if HE is spectating a certain player.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
Yeah I know what you mean, but it's not what he wants. He wants to know how to check if HE is spectating a certain player.
its grabbing local client and if it true so i think u would go about that like this>>>

function PISM()
{
if(IsSpectating(player GetLocalClientNumber(), true))
{
iPrintln("This Player Is Spectaing ^2>>", IsSpectating(player GetLocalClientNumber));
}
}//That what i get from the first one u posted

the first one i think is looking for first dead spectator

but u could also just download the spectator file and see
I don't think this would work because IsSpectating gives a true or false back, no player information or something like that. :smile: Maybe, if the function works like you're thinking, you could loop the check for all players and on this player which the current player is watching will return a true. But I'm not thinking that the function works like this. :smile: I will take a look into the raw files again and try to make a function. :smile:

Regards,
CabCon.
 
Top