mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-15 22:57:12 +02:00
Add the option to specify a header and payload when tracking player position changes.
This commit is contained in:
@ -1311,6 +1311,35 @@ void CPlayer::SetTrackPosition(SQInteger num) const
|
||||
Core::Get().GetPlayer(m_ID).mTrackPosition = num;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetTrackPositionEx(SQInteger num, Int32 header, const Object & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Assign the requested information
|
||||
Core::Get().GetPlayer(m_ID).mTrackPosition = num;
|
||||
Core::Get().GetPlayer(m_ID).mTrackPositionHeader = header;
|
||||
Core::Get().GetPlayer(m_ID).mTrackPositionPayload = payload;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CPlayer::GetTrackHeading() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Return the requested information
|
||||
return Core::Get().GetPlayer(m_ID).mTrackHeading;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetTrackHeading(SQInteger num) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Assign the requested information
|
||||
Core::Get().GetPlayer(m_ID).mTrackHeading = num;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 CPlayer::GetLastWeapon() const
|
||||
{
|
||||
@ -2223,6 +2252,7 @@ void Register_CPlayer(HSQUIRRELVM vm)
|
||||
.Prop(_SC("Spec"), &CPlayer::GetSpectator, &CPlayer::SetSpectator)
|
||||
.Prop(_SC("Authority"), &CPlayer::GetAuthority, &CPlayer::SetAuthority)
|
||||
.Prop(_SC("TrackPosition"), &CPlayer::GetTrackPosition, &CPlayer::SetTrackPosition)
|
||||
.Prop(_SC("TrackHeading"), &CPlayer::GetTrackHeading, &CPlayer::SetTrackHeading)
|
||||
.Prop(_SC("LastWeapon"), &CPlayer::GetLastWeapon)
|
||||
.Prop(_SC("LastHealth"), &CPlayer::GetLastHealth)
|
||||
.Prop(_SC("LastArmor"), &CPlayer::GetLastArmour)
|
||||
@ -2268,6 +2298,7 @@ void Register_CPlayer(HSQUIRRELVM vm)
|
||||
.Func(_SC("PlaySound"), &CPlayer::PlaySound)
|
||||
.Func(_SC("GetMsgPrefix"), &CPlayer::GetMessagePrefix)
|
||||
.Func(_SC("SetMsgPrefix"), &CPlayer::SetMessagePrefix)
|
||||
.Func(_SC("SetTrackPosition"), &CPlayer::SetTrackPositionEx)
|
||||
.Func(_SC("StreamByte"), &CPlayer::StreamByte)
|
||||
.Func(_SC("StreamShort"), &CPlayer::StreamShort)
|
||||
.Func(_SC("StreamInt"), &CPlayer::StreamInt)
|
||||
|
@ -761,10 +761,25 @@ public:
|
||||
SQInteger GetTrackPosition() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the amount of tracked position changes for the managed player entity.
|
||||
* Modify the amount of tracked position changes for the managed player entity.
|
||||
*/
|
||||
void SetTrackPosition(SQInteger num) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the amount of tracked position changes for the managed player entity.
|
||||
*/
|
||||
void SetTrackPositionEx(SQInteger num, Int32 header, const Object & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* 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;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the last known weapon for the managed player entity.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user