Raised This Month: $ Target: $400
 0% 

is_user_spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 05-03-2012 , 15:57   Re: is_user_spectate
Reply With Quote #11

Code:
stock GetSpectatedPlayer(id) {     if( !is_user_alive(id)     && ((1 << pev(id, pev_iuser1)) & ((1 << 1)|(1 << 2)|(1 << 4))) )     {         new player = pev(id, pev_iuser2);         if( is_user_alive(player) )         {             return player;         }     }         return client; // ??? }

return client shouldn't be return id ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2012 , 15:59   Re: is_user_spectate
Reply With Quote #12

Quote:
Originally Posted by mottzi View Post
die exolent explain me that please:
GetSpectatedPlayer()
GetSpectatedPlayer() returns the alive player that you are spectating while dead, or yourself if you are alive or not watching a specific player.

Quote:
Originally Posted by Devil259 View Post
return client shouldn't be return id ?
Yep, I made a typo.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 05-03-2012 , 16:29   Re: is_user_spectate
Reply With Quote #13

Exolent I got that, I asked you to explain the code
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2012 , 16:32   Re: is_user_spectate
Reply With Quote #14

pev_iuser1 hold the spectator mode.
The modes are like:
- first person
- chase cam
- locked chase cam
- free look
I don't remember each one's values, so you can just test yourself for a better understanding.

After checking if you are in a valid spectator mode, it puts the alive player's id in pev_iuser2.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 05-03-2012 , 16:36   Re: is_user_spectate
Reply With Quote #15

mottzi nah, let me make the purpose more clear.

PHP Code:
 if(!is_user_hltv id ) )
client_cmd(id"stop;wait;wait;record ^"%s^""Demof
what I would like to do is make sure the auto demo recording is done on players playing, not spectators.

thanks for replying claudiuhks && Exolent[jNr]
Ill make sure to try those out
vamppa is offline
CVarsMaster
Junior Member
Join Date: Mar 2009
Old 05-03-2012 , 19:15   Re: is_user_spectate
Reply With Quote #16

Quote:
Originally Posted by Exolent[jNr] View Post
pev_iuser1 hold the spectator mode.
The modes are like:
- first person
- chase cam
- locked chase cam
- free look
I don't remember each one's values, so you can just test yourself for a better understanding.

After checking if you are in a valid spectator mode, it puts the alive player's id in pev_iuser2.
PHP Code:
// Observator modes
enum
{
    
OBS_NONE 0,
    
OBS_CHASE_LOCKED,
    
OBS_CHASE_FREE
    
OBS_ROAMING// free look
    
OBS_IN_EYE// first person view
    
OBS_MAP_FREE
    
OBS_MAP_CHASE

CVarsMaster is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2012 , 21:15   Re: is_user_spectate
Reply With Quote #17

Quote:
Originally Posted by CVarsMaster View Post
PHP Code:
// Observator modes
enum
{
    
OBS_NONE 0,
    
OBS_CHASE_LOCKED,
    
OBS_CHASE_FREE
    
OBS_ROAMING// free look
    
OBS_IN_EYE// first person view
    
OBS_MAP_FREE
    
OBS_MAP_CHASE

Thanks! Saves others time, as well as me.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-04-2012 , 02:19   Re: is_user_spectate
Reply With Quote #18

Quote:
Originally Posted by mottzi View Post
I think he is asking about how to get wheter a player is spectating someone. If so: Check if player is dead AND if get_user_aiming returns a Player
I came with an edit about this.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
CVarsMaster
Junior Member
Join Date: Mar 2009
Old 05-04-2012 , 15:32   Re: is_user_spectate
Reply With Quote #19

Note: when player's deadflag is DEAD_DYING (when dying lol) his observator mode will be OBS_ROAMING (free look)
CVarsMaster is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 05-04-2012 , 16:09   Re: is_user_spectate
Reply With Quote #20

our mod has a command named "spectate" and an event named "spectate" perhaps something more efficient can be done with that?

Last edited by vamppa; 05-04-2012 at 16:09.
vamppa 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 05:11.


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