Raised This Month: $51 Target: $400
 12% 

Solved Get user spectator mode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 03-07-2017 , 15:39   Get user spectator mode
Reply With Quote #1

Greetings.I saw there is a set_view reference in amxmodx library, but still I wonder how can I get the spectator mode of the player? I mean, if user1 is spectator in 3rd person, I want to get that information on a variable.How can I do that?

Thanks in advance!

Last edited by iNvectus; 03-07-2017 at 16:14.
iNvectus is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-07-2017 , 15:50   Re: Get user spectator mode
Reply With Quote #2

Code:
/**
 * Spectating camera mode constants
 *
 * @note These constants are linked to different camera modes available when you
 *       are spectating (either dead or when in spectator team). Usually this is
 *       stored in the pev_iuser1 field in Counter-Strike and Half-Life games.
 */
#define OBS_NONE                        0
#define OBS_CHASE_LOCKED                1           // Locked Chase Cam
#define OBS_CHASE_FREE                  2           // Free Chase Cam
#define OBS_ROAMING                     3           // Free Look
#define OBS_IN_EYE                      4           // First Person
#define OBS_MAP_FREE                    5           // Free Overview
#define OBS_MAP_CHASE                   6           // Chase Overview
These constants are defined in 1.8.3-dev in hlsdk_const.inc. If you are using 1.8.2, you can do:
Code:
#if AMXX_VERSION_NUM < 183

#define OBS_NONE                        0
#define OBS_CHASE_LOCKED                1           // Locked Chase Cam
#define OBS_CHASE_FREE                  2           // Free Chase Cam
#define OBS_ROAMING                     3           // Free Look
#define OBS_IN_EYE                      4           // First Person
#define OBS_MAP_FREE                    5           // Free Overview
#define OBS_MAP_CHASE                   6           // Chase Overview

#endif
to make sure it will be compatible and won't break on 1.8.3.

Basically, using fakemeta you can get camera mode by using pev(player, pev_iuser1), and to get who a player is spectating, pev(player, pev_iuser2).

Last edited by klippy; 03-07-2017 at 15:51.
klippy 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 17:19.


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