Raised This Month: $ Target: $400
 0% 

is_user_spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-03-2012 , 15:12   Re: is_user_spectate
Reply With Quote #1

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 id; } stock bool:IsUserSpectatingPlayer(spectater, player) {     return (GetSpectatedPlayer(spectater) == player); } stock bool:IsUserSpectating(id) {     return (GetSpectatedPlayer(id) != id); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 05-03-2012 at 15:58.
Exolent[jNr] is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 05-03-2012 , 15:57   Re: is_user_spectate
Reply With Quote #2

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 #3

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
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