Raised This Month: $ Target: $400
 0% 

is_user_spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-03-2012 , 13:18   Re: is_user_spectate
Reply With Quote #1

PHP Code:
cs_get_user_team(id) != CS_TEAM_SPECTATOR 
?
__________________
<VeCo> is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-03-2012 , 13:23   Re: is_user_spectate
Reply With Quote #2

PHP Code:
// EITHER
#define is_user_spectator( %0 ) ( get_user_team( %0 ) == 3 )

// OR
boolis_user_spectatoriPlayer )
  return 
get_user_teamiPlayer ) == 3
Edit:

Or, if you want to know whether user is spectating someone:

PHP Code:
#define INVALID_PLAYER -1

get_user_spectating_targetiPlayer )
{
  static 
i;

  if( !
is_user_aliveiPlayer ) && is_user_connected( ( peviPlayerpev_iuser1 ) ) ) )
    return 
i;

  return 
INVALID_PLAYER;

Then, you can check:

PHP Code:
if( is_user_spectatoriClient ) && get_user_spectating_targetiClient ) != INVALID_PLAYER )
{
  
// His team is spectator and he is spectating a valid target
}

if( 
is_user_spectatoriClient ) )
{
  
// His team is spectator
}

if( 
get_user_spectating_targetiClient ) != INVALID_PLAYER )
{
  
// His team may be Red, Blue or Spectator and he is spectating a valid target

__________________

Last edited by claudiuhks; 05-04-2012 at 02:21.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-03-2012 , 13:48   Re: is_user_spectate
Reply With Quote #3

Quote:
Originally Posted by claudiuhks View Post
PHP Code:
// EITHER
#if !defined is_user_spectator
  #define is_user_spectator( %0 ) ( get_user_team( %0 ) == 3 )
#endif

// OR
boolis_user_spectatoriPlayer )
  return 
get_user_teamiPlayer ) == 3

i think 3 wont work, 0 = spectator?
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-03-2012 , 13:57   Re: is_user_spectate
Reply With Quote #4

Quote:
Originally Posted by Bilal Pro View Post
i think 3 wont work, 0 = spectator?
Think before posting.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 00:31.


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