2015-09-30 02:56:11 +02:00
|
|
|
#ifndef _ENTITY_PLAYER_HPP_
|
|
|
|
#define _ENTITY_PLAYER_HPP_
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
#include "Base/Shared.hpp"
|
2016-05-22 05:20:38 +02:00
|
|
|
#include "Base/Buffer.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Circular locks employed by the player manager.
|
|
|
|
*/
|
|
|
|
enum PlayerCircularLocks
|
|
|
|
{
|
2016-08-18 13:20:41 +02:00
|
|
|
PLAYERCL_EMIT_PLAYER_OPTION = (1 << 0),
|
2018-06-28 21:06:23 +02:00
|
|
|
PLAYERCL_EMIT_PLAYER_ADMIN = (1 << 1),
|
|
|
|
PLAYERCL_EMIT_PLAYER_WORLD = (1 << 2),
|
|
|
|
PLAYERCL_EMIT_PLAYER_TEAM = (1 << 3),
|
|
|
|
PLAYERCL_EMIT_PLAYER_SKIN = (1 << 4),
|
|
|
|
PLAYERCL_EMIT_PLAYER_MONEY = (1 << 5),
|
|
|
|
PLAYERCL_EMIT_PLAYER_SCORE = (1 << 6),
|
|
|
|
PLAYERCL_EMIT_PLAYER_WANTED_LEVEL = (1 << 7),
|
|
|
|
PLAYERCL_EMIT_PLAYER_IMMUNITY = (1 << 8),
|
|
|
|
PLAYERCL_EMIT_PLAYER_ALPHA = (1 << 9)
|
2016-05-22 05:20:38 +02:00
|
|
|
};
|
|
|
|
|
2015-09-30 02:56:11 +02:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Manages a single player entity.
|
2015-09-30 02:56:11 +02:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
class CPlayer
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
// --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
friend class Core;
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
private:
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2016-02-20 23:25:00 +01:00
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
static SQChar s_Buffer[SQMOD_PLAYER_TMP_BUFFER];
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2015-11-01 00:32:41 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Identifier of the managed entity.
|
2015-11-07 11:17:39 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
Int32 m_ID;
|
2015-11-07 11:17:39 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* User tag associated with this instance.
|
2015-11-07 11:17:39 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
String m_Tag;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* User data associated with this instance.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj m_Data;
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Buffer used to generate client data.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
Buffer m_Buffer;
|
2016-05-22 05:20:38 +02:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Prevent events from triggering themselves.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
Uint32 m_CircularLocks;
|
2016-05-22 05:20:38 +02:00
|
|
|
|
2015-11-09 04:54:03 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Base constructor.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
CPlayer(Int32 id);
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
public:
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
typedef String MsgPrefix[SQMOD_PLAYER_MSG_PREFIXES];
|
|
|
|
|
2015-11-09 04:54:03 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Maximum possible number that could represent an identifier for this entity type.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
static const Int32 Max;
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* The initial size of the allocated memory buffer when starting a new stream.
|
|
|
|
*/
|
|
|
|
Uint32 mBufferInitSize;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Default color to use in client messages.
|
|
|
|
*/
|
|
|
|
Uint32 mMessageColor;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Default style to use in client announcements.
|
|
|
|
*/
|
|
|
|
Int32 mAnnounceStyle;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Default ammo to give to the managed player when not specifying any.
|
|
|
|
*/
|
|
|
|
Int32 mDefaultAmmo;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set of strings to add before a client message automatically.
|
|
|
|
*/
|
|
|
|
String mMessagePrefix;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set of strings to add before a client message automatically.
|
|
|
|
*/
|
|
|
|
String mMessagePostfix;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set of strings to add before a client announcement automatically.
|
|
|
|
*/
|
|
|
|
String mAnnouncePrefix;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set of strings to add before a client announcement automatically.
|
|
|
|
*/
|
|
|
|
String mAnnouncePostfix;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set of strings to add before a client message automatically.
|
|
|
|
*/
|
|
|
|
MsgPrefix mMessagePrefixes;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Don't include the auto message prefix/postfix in already prefixed messages.
|
|
|
|
*/
|
|
|
|
bool mLimitPrefixPostfixMessage;
|
|
|
|
|
2015-11-09 04:54:03 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Copy constructor. (disabled)
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
CPlayer(const CPlayer &) = delete;
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Move constructor. (disabled)
|
|
|
|
*/
|
|
|
|
CPlayer(CPlayer &&) = delete;
|
2015-11-09 04:54:03 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Destructor.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
~CPlayer();
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Copy assignment operator. (disabled)
|
|
|
|
*/
|
|
|
|
CPlayer & operator = (const CPlayer &) = delete;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Move assignment operator. (disabled)
|
|
|
|
*/
|
|
|
|
CPlayer & operator = (CPlayer &&) = delete;
|
|
|
|
|
2015-11-09 04:54:03 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* See whether this instance manages a valid entity.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
void Validate() const
|
2016-02-20 23:25:00 +01:00
|
|
|
{
|
2016-03-10 04:57:13 +01:00
|
|
|
if (INVALID_ENTITY(m_ID))
|
2016-03-12 21:51:44 +01:00
|
|
|
{
|
2016-03-21 21:37:58 +01:00
|
|
|
STHROWF("Invalid player reference [%s]", m_Tag.c_str());
|
2016-03-12 21:51:44 +01:00
|
|
|
}
|
2016-02-20 23:25:00 +01:00
|
|
|
}
|
2015-11-09 04:54:03 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Used by the script engine to convert an instance of this type to a string.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & ToString() const;
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-08-07 00:54:33 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the associated null entity instance.
|
|
|
|
*/
|
|
|
|
static SQInteger SqGetNull(HSQUIRRELVM vm);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the associated null entity instance.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
static LightObj & GetNull();
|
2016-08-07 00:54:33 +02:00
|
|
|
|
2015-11-09 04:54:03 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Retrieve the identifier of the entity managed by this instance.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
Int32 GetID() const
|
|
|
|
{
|
|
|
|
return m_ID;
|
|
|
|
}
|
2015-11-09 04:54:03 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Check whether this instance manages a valid entity.
|
2015-11-09 04:54:03 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
bool IsActive() const
|
|
|
|
{
|
|
|
|
return VALID_ENTITY(m_ID);
|
|
|
|
}
|
2015-11-07 11:17:39 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Retrieve the associated user tag.
|
2015-10-29 21:11:30 +01:00
|
|
|
*/
|
2016-03-10 04:57:13 +01:00
|
|
|
const String & GetTag() const;
|
2015-10-29 21:11:30 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Modify the associated user tag.
|
2015-10-29 21:11:30 +01:00
|
|
|
*/
|
2016-11-16 13:49:04 +01:00
|
|
|
void SetTag(const StackStrF & tag);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the associated user tag.
|
|
|
|
*/
|
2016-11-16 14:10:33 +01:00
|
|
|
CPlayer & ApplyTag(const StackStrF & tag);
|
2015-10-29 21:11:30 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Retrieve the associated user data.
|
2015-10-29 21:11:30 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & GetData();
|
2015-10-29 21:11:30 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-02-20 23:25:00 +01:00
|
|
|
* Modify the associated user data.
|
2015-10-29 21:11:30 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void SetData(LightObj & data);
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2017-02-21 20:24:59 +01:00
|
|
|
* Retrieve the events table of this entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & GetEvents() const;
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2016-07-26 23:13:50 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Emit a custom event for the managed entity
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void CustomEvent(Int32 header, LightObj & payload) const;
|
2016-07-26 23:13:50 +02:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* See whether the managed player entity is connected.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool IsConnected() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* See if the managed player entity is streamed for the specified player.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool IsStreamedFor(CPlayer & player) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity has administrator privileges.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool GetAdmin() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed player entity has administrator privileges.
|
|
|
|
*/
|
2016-08-17 14:40:48 +02:00
|
|
|
void SetAdmin(bool toggle);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the ip address of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
CSStr GetIP() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the unique user identifier of the managed player entity.
|
|
|
|
*/
|
|
|
|
CSStr GetUID() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the unique user identifier version 2 of the managed player entity.
|
|
|
|
*/
|
|
|
|
CSStr GetUID2() const;
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Kick the managed player entity from the server.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void Kick() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-08-17 12:48:29 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Kick the managed player entity from the server.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void KickBecause(Int32 header, LightObj & payload) const;
|
2016-08-17 12:48:29 +02:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Ban the managed player entity from the server.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void Ban() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-08-17 12:48:29 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Ban the managed player entity from the server.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void BanBecause(Int32 header, LightObj & payload) const;
|
2016-08-17 12:48:29 +02:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the key of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Uint32 GetKey() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the nick name of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
CSStr GetName() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the nick name of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-11-16 14:10:33 +01:00
|
|
|
void SetName(const StackStrF & name) const;
|
2016-05-22 05:20:38 +02:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the current state of the managed player entity.
|
|
|
|
*/
|
|
|
|
Int32 GetState() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the current option value of the managed player entity.
|
|
|
|
*/
|
|
|
|
Int32 GetOption(Int32 option_id) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the current option value of the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetOption(Int32 option_id, bool toggle);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the current option value of the managed player entity.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the world in which the managed player entity exists.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetWorld() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the world in which the managed player entity exists.
|
|
|
|
*/
|
2016-08-17 14:45:44 +02:00
|
|
|
void SetWorld(Int32 world);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the secondary world of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetSecondaryWorld() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the secondary world of the managed player entity.
|
|
|
|
*/
|
2016-08-17 15:10:43 +02:00
|
|
|
void SetSecondaryWorld(Int32 world);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the unique world of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetUniqueWorld() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity is compatible with the specified world.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
bool IsWorldCompatible(Int32 world) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the class of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetClass() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the team of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetTeam() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the team of the managed player entity.
|
|
|
|
*/
|
2016-08-17 14:49:08 +02:00
|
|
|
void SetTeam(Int32 team);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the skin identifier of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetSkin() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the skin identifier of the managed player entity.
|
|
|
|
*/
|
2016-08-17 14:52:22 +02:00
|
|
|
void SetSkin(Int32 skin);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the color of the managed player entity.
|
|
|
|
*/
|
2017-08-06 20:15:32 +02:00
|
|
|
Color3 GetColor() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the color of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetColor(const Color3 & color) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the color of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetColorEx(Uint8 r, Uint8 g, Uint8 b) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity is spawned.
|
|
|
|
*/
|
|
|
|
bool IsSpawned() const;
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Force the managed player entity to spawn in the game.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void ForceSpawn() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Force the managed player entity to select a class.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void ForceSelect() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity is typing.
|
|
|
|
*/
|
|
|
|
bool IsTyping() const;
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the money amount of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetMoney() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the money amount of the managed player entity.
|
|
|
|
*/
|
2016-08-17 14:55:59 +02:00
|
|
|
void SetMoney(Int32 amount);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Give a certain amount of money to the managed player entity.
|
|
|
|
*/
|
2016-08-17 14:55:59 +02:00
|
|
|
void GiveMoney(Int32 amount);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the score of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetScore() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the score of the managed player entity.
|
|
|
|
*/
|
2016-08-17 15:00:28 +02:00
|
|
|
void SetScore(Int32 score);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the wanted level of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetWantedLevel() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the wanted level of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-08-17 15:04:14 +02:00
|
|
|
void SetWantedLevel(Int32 level);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the connection latency of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetPing() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the frames per second of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetFPS() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the current health of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetHealth() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the health of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetHealth(Float32 amount) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the current health of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetArmor() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the health of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetArmor(Float32 amount) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the immunity flags of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetImmunity() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the immunity flags of the managed player entity.
|
|
|
|
*/
|
2016-08-17 15:07:31 +02:00
|
|
|
void SetImmunity(Int32 flags);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position of the managed player entity.
|
|
|
|
*/
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 GetPosition() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetPosition(const Vector3 & pos) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetPositionEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the speed of the managed player entity.
|
|
|
|
*/
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 GetSpeed() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void AddSpeed(const Vector3 & vel) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the speed of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void AddSpeedEx(Float32 x, Float32 y, Float32 z) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the heading angle of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Float32 GetHeading() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the heading angle of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetHeading(Float32 angle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the alpha of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
Int32 GetAlpha() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the alpha of the managed player entity.
|
|
|
|
*/
|
2016-08-17 15:10:43 +02:00
|
|
|
void SetAlpha(Int32 alpha);
|
2016-06-20 07:08:33 +02:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the alpha of the managed player entity.
|
|
|
|
*/
|
2016-08-17 15:10:43 +02:00
|
|
|
void SetAlphaEx(Int32 alpha, Int32 fade);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the aim position of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 GetAimPosition() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the aim direction of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2017-08-06 20:15:32 +02:00
|
|
|
Vector3 GetAimDirection() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* See whether the managed player entity is burning.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool IsBurning() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* See whether the managed player entity is crouched.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool IsCrouched() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the current action of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetAction() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the game keys of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetGameKeys() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Embark the managed player entity into the specified vehicle entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool Embark(CVehicle & vehicle) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Embark the managed player entity into the specified vehicle entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
bool Embark(CVehicle & vehicle, Int32 slot, bool allocate, bool warp) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Disembark the managed player entity from the currently embarked vehicle entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void Disembark() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the vehicle status of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetVehicleStatus() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the occupied vehicle slot by the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetVehicleSlot() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the vehicle in which the managed player entity is embarked.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & GetVehicle() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the vehicle identifier in which the managed player entity is embarked.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetVehicleID() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the weapon identifier of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetWeapon() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the weapon of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetWeapon(Int32 wep) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the weapon of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetWeaponEx(Int32 wep, Int32 ammo) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Give a weapon of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void GiveWeapon(Int32 wep, Int32 ammo) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the active weapon ammo of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetAmmo() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the weapon slot of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetWeaponSlot() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the weapon slot of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetWeaponSlot(Int32 slot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the weapon identifier at the specified slot for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetWeaponAtSlot(Int32 slot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the ammo from the weapon at the specified slot for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetAmmoAtSlot(Int32 slot) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Remove a certain weapon from the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void RemoveWeapon(Int32 wep) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Strip the managed player entity of all weapons.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void StripWeapons() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the camera position of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void SetCameraPosition(const Vector3 & pos, const Vector3 & aim) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the camera position of the managed player entity.
|
|
|
|
*/
|
2016-02-20 23:25:00 +01:00
|
|
|
void SetCameraPosition(Float32 xp, Float32 yp, Float32 zp, Float32 xa, Float32 ya, Float32 za) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Restore the camera position of the managed player entity.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
void RestoreCamera() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity has camera locked.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
bool IsCameraLocked() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the animation of the managed player entity.
|
|
|
|
*/
|
2016-06-15 05:06:03 +02:00
|
|
|
void SetAnimation(Int32 anim) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the animation of the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetAnimation(Int32 anim, Int32 group) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the vehicle that the managed player entity is standing on.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & StandingOnVehicle() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the object that the managed player entity is standing on.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & StandingOnObject() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity is away.
|
|
|
|
*/
|
2015-11-01 04:48:01 +01:00
|
|
|
bool IsAway() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the player that the managed player entity is spectating.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & GetSpectator() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set the managed player entity to spectate the specified player entity.
|
|
|
|
*/
|
2017-08-06 14:14:45 +02:00
|
|
|
void SetSpectator(CPlayer & target) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the identifier of the player that the managed player entity is spectating.
|
|
|
|
*/
|
|
|
|
SQInteger GetSpectatorID() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set the managed player entity to spectate the specified player entity.
|
|
|
|
*/
|
|
|
|
void SetSpectatorID(SQInteger id) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set the managed player entity to spectate no one.
|
|
|
|
*/
|
2017-08-06 17:24:42 +02:00
|
|
|
void Unspectate() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Redirect the managed player entity to the specified server.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-11-16 13:49:04 +01:00
|
|
|
void Redirect(const StackStrF & ip, Uint32 port, const StackStrF & nick,
|
|
|
|
const StackStrF & server_pass, const StackStrF & user_pass);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2018-06-28 20:46:06 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Request a list of the modules loaded into the client session.
|
|
|
|
*/
|
|
|
|
void GetModuleList() const;
|
|
|
|
|
2016-06-20 07:27:39 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the authority level of the managed player entity.
|
|
|
|
*/
|
|
|
|
void PlaySound(Int32 sound_id) const;
|
|
|
|
|
2016-06-24 22:37:58 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Create a checkpoint or sphere for this player.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
2016-06-24 22:37:58 +02:00
|
|
|
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Create a checkpoint or sphere for this player.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
2016-06-24 22:37:58 +02:00
|
|
|
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
|
2017-02-21 20:24:59 +01:00
|
|
|
Int32 header, LightObj & payload) const;
|
2016-06-24 22:37:58 +02:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Create a checkpoint or sphere for this player.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
|
2016-06-24 22:37:58 +02:00
|
|
|
const Color4 & color, Float32 radius) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Create a checkpoint or sphere for this player.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
|
|
|
|
Float32 radius, Int32 header, LightObj & payload) const;
|
2016-06-24 22:37:58 +02:00
|
|
|
|
2017-06-19 03:09:35 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* See whether the managed player entity collides with user defined areas.
|
|
|
|
*/
|
|
|
|
bool GetCollideAreas() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed player entity can collide with user defined areas.
|
|
|
|
*/
|
|
|
|
void SetCollideAreas(bool toggle) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Set whether the managed player entity can collide with user defined areas (with last test).
|
|
|
|
*/
|
|
|
|
void SetAreasCollide(bool toggle) const;
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the authority level of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetAuthority() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the authority level of the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetAuthority(Int32 level) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the message prefix at the specified index for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
const String & GetMessagePrefix(Uint32 index) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Modify the message prefix at the specified index for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-11-16 14:10:33 +01:00
|
|
|
void SetMessagePrefix(Uint32 index, const StackStrF & prefix);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-06-08 15:53:16 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the amount of tracked position changes for the managed player entity.
|
|
|
|
*/
|
|
|
|
SQInteger GetTrackPosition() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-07-14 18:52:14 +02:00
|
|
|
* Modify the amount of tracked position changes for the managed player entity.
|
2016-06-08 15:53:16 +02:00
|
|
|
*/
|
|
|
|
void SetTrackPosition(SQInteger num) const;
|
|
|
|
|
2016-07-14 18:52:14 +02:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the amount of tracked position changes for the managed player entity.
|
|
|
|
*/
|
2017-02-21 20:24:59 +01:00
|
|
|
void SetTrackPositionEx(SQInteger num, Int32 header, const LightObj & payload) const;
|
2016-07-14 18:52:14 +02:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the amount of tracked heading changes for the managed player entity.
|
|
|
|
*/
|
|
|
|
SQInteger GetTrackHeading() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the amount of tracked heading changes for the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetTrackHeading(SQInteger num) const;
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the last known weapon for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetLastWeapon() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the last known health for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetLastHealth() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the last known armour for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetLastArmour() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the last known heading for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetLastHeading() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the last known position for the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
const Vector3 & GetLastPosition() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Start a new stream with the default size.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void StartStream();
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Start a new stream with a custom size.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void StartStream(Uint32 size);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the current cursor position of the stream buffer.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Int32 GetBufferCursor() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the current cursor position of the stream buffer.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetBufferCursor(Int32 pos);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Write a 8bit byte to the stream buffer.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void StreamByte(SQInteger val);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Write a 16bit short to the stream buffer.
|
|
|
|
*/
|
|
|
|
void StreamShort(SQInteger val);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Write a 32bit integer to the stream buffer.
|
|
|
|
*/
|
|
|
|
void StreamInt(SQInteger val);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Write a 32bit float to the stream buffer.
|
|
|
|
*/
|
|
|
|
void StreamFloat(SQFloat val);
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Write a string to the stream buffer.
|
|
|
|
*/
|
2016-11-16 14:10:33 +01:00
|
|
|
void StreamString(const StackStrF & val);
|
2016-05-22 05:20:38 +02:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Write a raw string to the stream buffer.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-11-16 14:10:33 +01:00
|
|
|
void StreamRawString(const StackStrF & val);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Send the data in the stream buffer to the client.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void FlushStream(bool reset);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Retrieve the total capacity of the buffer stream in bytes.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Uint32 GetBufferCapacity() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
* Send the specified buffer contents to the managed player entity.
|
2016-03-10 04:57:13 +01:00
|
|
|
*/
|
2016-07-07 23:56:54 +02:00
|
|
|
void SendBuffer(const SqBuffer & buffer) const;
|
2015-10-29 21:11:30 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the x axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetPositionX() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the y axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetPositionY() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the position on the z axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
Float32 GetPositionZ() const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the x axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetPositionX(Float32 x) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the y axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetPositionY(Float32 y) const;
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Modify the position on the z axis of the managed player entity.
|
|
|
|
*/
|
2016-05-22 05:20:38 +02:00
|
|
|
void SetPositionZ(Float32 z) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the red color of the managed player entity.
|
|
|
|
*/
|
|
|
|
Int32 GetColorR() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the green color of the managed player entity.
|
|
|
|
*/
|
|
|
|
Int32 GetColorG() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the blue color of the managed player entity.
|
|
|
|
*/
|
|
|
|
Int32 GetColorB() const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the red color of the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetColorR(Int32 r) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the green color of the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetColorG(Int32 g) const;
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Retrieve the blue color of the managed player entity.
|
|
|
|
*/
|
|
|
|
void SetColorB(Int32 b) const;
|
2015-11-09 02:29:04 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted colored message to the managed player entity.
|
|
|
|
*/
|
2015-11-09 02:29:04 +01:00
|
|
|
static SQInteger Msg(HSQUIRRELVM vm);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted message with a prefix to the managed player entity.
|
|
|
|
*/
|
2015-11-09 03:32:32 +01:00
|
|
|
static SQInteger MsgP(HSQUIRRELVM vm);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted colored message to the managed player entity.
|
|
|
|
*/
|
2015-11-09 02:29:04 +01:00
|
|
|
static SQInteger MsgEx(HSQUIRRELVM vm);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted message to the managed player entity.
|
|
|
|
*/
|
2015-11-09 02:29:04 +01:00
|
|
|
static SQInteger Message(HSQUIRRELVM vm);
|
2016-03-10 04:57:13 +01:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted announcement message to the managed player entity.
|
|
|
|
*/
|
2015-11-09 02:29:04 +01:00
|
|
|
static SQInteger Announce(HSQUIRRELVM vm);
|
2015-11-09 04:54:03 +01:00
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* --------------------------------------------------------------------------------------------
|
|
|
|
* Send a formatted announcement message to the managed player entity.
|
|
|
|
*/
|
|
|
|
static SQInteger AnnounceEx(HSQUIRRELVM vm);
|
2015-09-30 02:56:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|
|
|
|
|
2016-08-17 15:10:43 +02:00
|
|
|
#endif // _ENTITY_PLAYER_HPP_
|