AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Get user spectator mode (https://forums.alliedmods.net/showthread.php?t=294783)

iNvectus 03-07-2017 15:39

Get user spectator mode
 
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!

klippy 03-07-2017 15:50

Re: Get user spectator mode
 
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).


All times are GMT -4. The time now is 17:51.

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