mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-05 07:31:48 +02:00
Dumped the old implementation. Started with a more simple approach.
This commit is contained in:
@@ -1,289 +0,0 @@
|
||||
#include "Misc/Automobile.hpp"
|
||||
#include "Base/Color3.hpp"
|
||||
#include "Base/Vector3.hpp"
|
||||
#include "Entity.hpp"
|
||||
#include "Register.hpp"
|
||||
#include "Core.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const CAutomobile CAutomobile::NIL;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile::CAutomobile()
|
||||
: m_ID(SQMOD_UNKNOWN)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAutomobile::CAutomobile(SQInt32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, Max))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAutomobile::CAutomobile(const SQChar * name, SQInt32 id)
|
||||
: m_ID(GetAutomobileID(name))
|
||||
{
|
||||
if (VALID_ENTITYEX(m_ID, Max))
|
||||
{
|
||||
m_ID = id;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile::CAutomobile(const CAutomobile & a)
|
||||
: m_ID(a.m_ID)
|
||||
, m_Tag(a.m_Tag)
|
||||
, m_Data(a.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAutomobile::CAutomobile(CAutomobile && a)
|
||||
: m_ID(a.m_ID)
|
||||
, m_Tag(a.m_Tag)
|
||||
, m_Data(a.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile::~CAutomobile()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile & CAutomobile::operator = (const CAutomobile & a)
|
||||
{
|
||||
m_ID = a.m_ID;
|
||||
m_Tag = a.m_Tag;
|
||||
m_Data = a.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CAutomobile & CAutomobile::operator = (CAutomobile && a)
|
||||
{
|
||||
m_ID = a.m_ID;
|
||||
m_Tag = a.m_Tag;
|
||||
m_Data = a.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile & CAutomobile::operator = (SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CAutomobile::operator == (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID == a.m_ID);
|
||||
}
|
||||
|
||||
bool CAutomobile::operator != (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID != a.m_ID);
|
||||
}
|
||||
|
||||
bool CAutomobile::operator < (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID < a.m_ID);
|
||||
}
|
||||
|
||||
bool CAutomobile::operator > (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID < a.m_ID);
|
||||
}
|
||||
|
||||
bool CAutomobile::operator <= (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID <= a.m_ID);
|
||||
}
|
||||
|
||||
bool CAutomobile::operator >= (const CAutomobile & a) const
|
||||
{
|
||||
return (m_ID >= a.m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CAutomobile::Cmp(const CAutomobile & a) const
|
||||
{
|
||||
if (m_ID == a.m_ID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (m_ID > a.m_ID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CAutomobile::ToString() const
|
||||
{
|
||||
return GetAutomobileName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CAutomobile::GetID() const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
void CAutomobile::SetID(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CAutomobile & CAutomobile::SetnGet(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CAutomobile::GetGlobalTag() const
|
||||
{
|
||||
return GlobalTag(m_ID);
|
||||
}
|
||||
|
||||
void CAutomobile::SetGlobalTag(const SQChar * tag) const
|
||||
{
|
||||
GlobalTag(m_ID, tag);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CAutomobile::GetGlobalData() const
|
||||
{
|
||||
return GlobalData(m_ID);
|
||||
}
|
||||
|
||||
void CAutomobile::SetGlobalData(SqObj & data) const
|
||||
{
|
||||
GlobalData(m_ID, data);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CAutomobile::GetLocalTag() const
|
||||
{
|
||||
return m_Tag.c_str();
|
||||
}
|
||||
|
||||
void CAutomobile::SetLocalTag(const SQChar * tag)
|
||||
{
|
||||
m_Tag = tag;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CAutomobile::GetLocalData()
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
|
||||
void CAutomobile::SetLocalData(SqObj & data)
|
||||
{
|
||||
m_Data = data;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CAutomobile::IsValid() const
|
||||
{
|
||||
return (VALID_ENTITYEX(m_ID, Max));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CAutomobile::GetName() const
|
||||
{
|
||||
return GetAutomobileName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CAutomobile::SetName(const SQChar * name)
|
||||
{
|
||||
m_ID = GetAutomobileID(name);
|
||||
m_ID = VALID_ENTITYGETEX(m_ID, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Reference< CVehicle > CAutomobile::Create(SQInt32 world, const Vector3 & pos, SQFloat angle,
|
||||
SQInt32 header, SqObj & payload) const
|
||||
{
|
||||
return _Core->NewVehicle(m_ID, world, pos.x, pos.z, pos.y, angle, SQMOD_UNKNOWN, SQMOD_UNKNOWN, header, payload);
|
||||
}
|
||||
|
||||
Reference< CVehicle > CAutomobile::Create(SQInt32 world, const Vector3 & pos, SQFloat angle,
|
||||
SQInt32 primary, SQInt32 secondary, SQInt32 header,
|
||||
SqObj & payload) const
|
||||
{
|
||||
return _Core->NewVehicle(*this, world, pos.x, pos.z, pos.y, angle, primary, secondary, header, payload);
|
||||
}
|
||||
|
||||
Reference< CVehicle > CAutomobile::Create(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQFloat angle,
|
||||
SQInt32 header, SqObj & payload) const
|
||||
{
|
||||
return _Core->NewVehicle(*this, world, x, y, z, angle, SQMOD_UNKNOWN, SQMOD_UNKNOWN, header, payload);
|
||||
}
|
||||
|
||||
Reference< CVehicle > CAutomobile::Create(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQFloat angle,
|
||||
SQInt32 primary, SQInt32 secondary, SQInt32 header,
|
||||
SqObj & payload) const
|
||||
{
|
||||
return _Core->NewVehicle(*this, world, x, y, z, angle, primary, secondary, header, payload);
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_CAutomobile(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <CAutomobile> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("CAutomobile"), Sqrat::Class< CAutomobile >(vm, _SC("CAutomobile"))
|
||||
/* Constructors */
|
||||
.Ctor()
|
||||
.Ctor< SQInt32 >()
|
||||
.Ctor< const SQChar *, SQInt32 >()
|
||||
/* Metamethods */
|
||||
.Func(_SC("_cmp"), &CAutomobile::Cmp)
|
||||
.Func(_SC("_tostring"), &CAutomobile::ToString)
|
||||
/* Properties */
|
||||
.Prop(_SC("id"), &CAutomobile::GetID, &CAutomobile::SetID)
|
||||
.Prop(_SC("gtag"), &CAutomobile::GetGlobalTag, &CAutomobile::SetGlobalTag)
|
||||
.Prop(_SC("gdata"), &CAutomobile::GetGlobalData, &CAutomobile::SetGlobalData)
|
||||
.Prop(_SC("ltag"), &CAutomobile::GetLocalTag, &CAutomobile::SetLocalTag)
|
||||
.Prop(_SC("ldata"), &CAutomobile::GetLocalData, &CAutomobile::SetLocalData)
|
||||
.Prop(_SC("valid"), &CAutomobile::IsValid)
|
||||
.Prop(_SC("name"), &CAutomobile::GetName, &CAutomobile::SetName)
|
||||
/* Functions */
|
||||
.Func(_SC("setng"), &CAutomobile::SetnGet)
|
||||
/* Overloads */
|
||||
.Overload< Reference< CVehicle > (CAutomobile::*)(SQInt32, const Vector3 &, SQFloat, SQInt32, SqObj &) const >
|
||||
(_SC("vehicle"), &CAutomobile::Create)
|
||||
.Overload< Reference< CVehicle > (CAutomobile::*)(SQInt32, const Vector3 &, SQFloat, SQInt32, SQInt32, SQInt32, SqObj &) const >
|
||||
(_SC("vehicle"), &CAutomobile::Create)
|
||||
.Overload< Reference< CVehicle > (CAutomobile::*)(SQInt32, SQFloat, SQFloat, SQFloat, SQFloat, SQInt32, SqObj &) const >
|
||||
(_SC("vehicle"), &CAutomobile::Create)
|
||||
.Overload< Reference< CVehicle > (CAutomobile::*)(SQInt32, SQFloat, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SQInt32, SqObj &) const >
|
||||
(_SC("vehicle"), &CAutomobile::Create)
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CAutomobile> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,257 +0,0 @@
|
||||
#ifndef _MISC_AUTOMOBILE_HPP_
|
||||
#define _MISC_AUTOMOBILE_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Shared.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Class responsible for managing and interacting with vehicle models.
|
||||
*/
|
||||
class CAutomobile : public IdentifierStorage< CAutomobile, SQMOD_VEHICLEID_CAP >
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Helper member for times when a null reference to an instance of this type is needed.
|
||||
*/
|
||||
static const CAutomobile NIL;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Default constructor.
|
||||
*/
|
||||
CAutomobile();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model specified.
|
||||
*/
|
||||
CAutomobile(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model extracted from the specified name.
|
||||
*/
|
||||
CAutomobile(const SQChar * name, SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy constructor.
|
||||
*/
|
||||
CAutomobile(const CAutomobile & a);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move constructor.
|
||||
*/
|
||||
CAutomobile(CAutomobile && a);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*/
|
||||
~CAutomobile();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy assignment operator.
|
||||
*/
|
||||
CAutomobile & operator = (const CAutomobile & a);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move assignment operator.
|
||||
*/
|
||||
CAutomobile & operator = (CAutomobile && a);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Model identifier assignment operator.
|
||||
*/
|
||||
CAutomobile & operator = (SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Equality comparison operator.
|
||||
*/
|
||||
bool operator == (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Inequality comparison operator.
|
||||
*/
|
||||
bool operator != (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than comparison operator.
|
||||
*/
|
||||
bool operator < (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than comparison operator.
|
||||
*/
|
||||
bool operator > (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than or equal comparison operator.
|
||||
*/
|
||||
bool operator <= (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than or equal comparison operator.
|
||||
*/
|
||||
bool operator >= (const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to model identifier.
|
||||
*/
|
||||
operator SQInt32 () const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to model identifier.
|
||||
*/
|
||||
operator Int64 () const
|
||||
{
|
||||
return _SCI64(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to boolean.
|
||||
*/
|
||||
operator bool () const
|
||||
{
|
||||
return IsAutomobileValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Negation operator.
|
||||
*/
|
||||
bool operator ! () const
|
||||
{
|
||||
return !IsAutomobileValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script to compare two instances of this type.
|
||||
*/
|
||||
SQInteger Cmp(const CAutomobile & a) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Convert this type to a string.
|
||||
*/
|
||||
const SQChar * ToString() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier referenced by this instance.
|
||||
*/
|
||||
SQInteger GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier referenced by this instance.
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the identifier that this insance should reference and
|
||||
* get a reference to the instance to chain operations.
|
||||
*/
|
||||
CAutomobile & SetnGet(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global tag.
|
||||
*/
|
||||
const SQChar * GetGlobalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global tag.
|
||||
*/
|
||||
void SetGlobalTag(const SQChar * tag) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global data.
|
||||
*/
|
||||
SqObj & GetGlobalData() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global data.
|
||||
*/
|
||||
void SetGlobalData(SqObj & data) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local tag.
|
||||
*/
|
||||
const SQChar * GetLocalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local tag.
|
||||
*/
|
||||
void SetLocalTag(const SQChar * tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local data.
|
||||
*/
|
||||
SqObj & GetLocalData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local data.
|
||||
*/
|
||||
void SetLocalData(SqObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the referenced model identifier is valid.
|
||||
*/
|
||||
bool IsValid() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the name of the referenced model.
|
||||
*/
|
||||
const SQChar * GetName() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier of the referenced model.
|
||||
*/
|
||||
void SetName(const SQChar * name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a vehicle instance using the referenced model.
|
||||
*/
|
||||
Reference < CVehicle > Create(SQInt32 world, const Vector3 & pos, SQFloat angle,
|
||||
SQInt32 header, SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a vehicle instance using the referenced model.
|
||||
*/
|
||||
Reference < CVehicle > Create(SQInt32 world, const Vector3 & pos, SQFloat angle,
|
||||
SQInt32 primary, SQInt32 secondary, SQInt32 header,
|
||||
SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a vehicle instance using the referenced model.
|
||||
*/
|
||||
Reference < CVehicle > Create(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQFloat angle,
|
||||
SQInt32 header, SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a vehicle instance using the referenced model.
|
||||
*/
|
||||
Reference < CVehicle > Create(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQFloat angle,
|
||||
SQInt32 primary, SQInt32 secondary, SQInt32 header,
|
||||
SqObj & payload) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The identifier of the referenced model.
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local tag associated with this instance.
|
||||
*/
|
||||
SqTag m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local data associated with this instance.
|
||||
*/
|
||||
SqObj m_Data;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_AUTOMOBILE_HPP_
|
@@ -1,936 +0,0 @@
|
||||
#include "Misc/Constants.hpp"
|
||||
#include "Signal.hpp"
|
||||
#include "Register.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <limits>
|
||||
#include <cfloat>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_Constants(HSQUIRRELVM vm)
|
||||
{
|
||||
Sqrat::ConstTable(vm).Enum(_SC("SQMOD"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("VERSION"), SQMOD_VERSION)
|
||||
.Const(_SC("SUCCESS"), SQMOD_SUCCESS)
|
||||
.Const(_SC("FAILURE"), SQMOD_FAILURE)
|
||||
.Const(_SC("UNKNOWN"), SQMOD_UNKNOWN)
|
||||
.Const(_SC("ARCH"), SQMOD_ARCHITECTURE)
|
||||
.Const(_SC("PLATFORM"), SQMOD_PLATFORM)
|
||||
.Const(_SC("MIN_CHAR"), _NLMIN(SQChar))
|
||||
.Const(_SC("MAX_CHAR"), _NLMAX(SQChar))
|
||||
.Const(_SC("MIN_SHORT"), _NLMIN(Int16))
|
||||
.Const(_SC("MAX_SHORT"), _NLMAX(Int16))
|
||||
.Const(_SC("MIN_USHORT"), _NLMIN(Uint16))
|
||||
.Const(_SC("MAX_USHORT"), _NLMAX(Uint16))
|
||||
.Const(_SC("MIN_INT"), _NLMIN(SQInteger))
|
||||
.Const(_SC("MAX_INT"), _NLMAX(SQInteger))
|
||||
.Const(_SC("MIN_INT32"), _NLMIN(SQInt32))
|
||||
.Const(_SC("MAX_INT32"), _NLMAX(SQInt32))
|
||||
.Const(_SC("MIN_FLOAT"), _NLMIN(SQFloat))
|
||||
.Const(_SC("MAX_FLOAT"), _NLMAX(SQFloat))
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EARCHITECTURE"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNOWN"), SQMOD_ARCH_ID_UNKNOWN)
|
||||
.Const(_SC("X32_BIT"), SQMOD_ARCH_ID_32_BIT)
|
||||
.Const(_SC("X64_BIT"), SQMOD_ARCH_ID_64_BIT)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EPLATFORM"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNOWN"), SQMOD_PLAT_ID_UNKNOWN)
|
||||
.Const(_SC("WINDOWS"), SQMOD_PLAT_ID_WINDOWS)
|
||||
.Const(_SC("LINUX"), SQMOD_PLAT_ID_LINUX)
|
||||
.Const(_SC("MACOS"), SQMOD_PLAT_ID_MACOS)
|
||||
.Const(_SC("UNIX"), SQMOD_PLAT_ID_UNIX)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EVENTID"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNOWN"), EVT_UNKNOWN)
|
||||
.Const(_SC("BLIPCREATED"), EVT_BLIPCREATED)
|
||||
.Const(_SC("CHECKPOINTCREATED"), EVT_CHECKPOINTCREATED)
|
||||
.Const(_SC("KEYBINDCREATED"), EVT_KEYBINDCREATED)
|
||||
.Const(_SC("OBJECTCREATED"), EVT_OBJECTCREATED)
|
||||
.Const(_SC("PICKUPCREATED"), EVT_PICKUPCREATED)
|
||||
.Const(_SC("PLAYERCREATED"), EVT_PLAYERCREATED)
|
||||
.Const(_SC("SPHERECREATED"), EVT_SPHERECREATED)
|
||||
.Const(_SC("SPRITECREATED"), EVT_SPRITECREATED)
|
||||
.Const(_SC("TEXTDRAWCREATED"), EVT_TEXTDRAWCREATED)
|
||||
.Const(_SC("VEHICLECREATED"), EVT_VEHICLECREATED)
|
||||
.Const(_SC("BLIPDESTROYED"), EVT_BLIPDESTROYED)
|
||||
.Const(_SC("CHECKPOINTDESTROYED"), EVT_CHECKPOINTDESTROYED)
|
||||
.Const(_SC("KEYBINDDESTROYED"), EVT_KEYBINDDESTROYED)
|
||||
.Const(_SC("OBJECTDESTROYED"), EVT_OBJECTDESTROYED)
|
||||
.Const(_SC("PICKUPDESTROYED"), EVT_PICKUPDESTROYED)
|
||||
.Const(_SC("PLAYERDESTROYED"), EVT_PLAYERDESTROYED)
|
||||
.Const(_SC("SPHEREDESTROYED"), EVT_SPHEREDESTROYED)
|
||||
.Const(_SC("SPRITEDESTROYED"), EVT_SPRITEDESTROYED)
|
||||
.Const(_SC("TEXTDRAWDESTROYED"), EVT_TEXTDRAWDESTROYED)
|
||||
.Const(_SC("VEHICLEDESTROYED"), EVT_VEHICLEDESTROYED)
|
||||
.Const(_SC("BLIPCUSTOM"), EVT_BLIPCUSTOM)
|
||||
.Const(_SC("CHECKPOINTCUSTOM"), EVT_CHECKPOINTCUSTOM)
|
||||
.Const(_SC("KEYBINDCUSTOM"), EVT_KEYBINDCUSTOM)
|
||||
.Const(_SC("OBJECTCUSTOM"), EVT_OBJECTCUSTOM)
|
||||
.Const(_SC("PICKUPCUSTOM"), EVT_PICKUPCUSTOM)
|
||||
.Const(_SC("PLAYERCUSTOM"), EVT_PLAYERCUSTOM)
|
||||
.Const(_SC("SPHERECUSTOM"), EVT_SPHERECUSTOM)
|
||||
.Const(_SC("SPRITECUSTOM"), EVT_SPRITECUSTOM)
|
||||
.Const(_SC("TEXTDRAWCUSTOM"), EVT_TEXTDRAWCUSTOM)
|
||||
.Const(_SC("VEHICLECUSTOM"), EVT_VEHICLECUSTOM)
|
||||
.Const(_SC("PLAYERAWAY"), EVT_PLAYERAWAY)
|
||||
.Const(_SC("PLAYERGAMEKEYS"), EVT_PLAYERGAMEKEYS)
|
||||
.Const(_SC("PLAYERRENAME"), EVT_PLAYERRENAME)
|
||||
.Const(_SC("PLAYERREQUESTCLASS"), EVT_PLAYERREQUESTCLASS)
|
||||
.Const(_SC("PLAYERREQUESTSPAWN"), EVT_PLAYERREQUESTSPAWN)
|
||||
.Const(_SC("PLAYERSPAWN"), EVT_PLAYERSPAWN)
|
||||
.Const(_SC("PLAYERSTARTTYPING"), EVT_PLAYERSTARTTYPING)
|
||||
.Const(_SC("PLAYERSTOPTYPING"), EVT_PLAYERSTOPTYPING)
|
||||
.Const(_SC("PLAYERCHAT"), EVT_PLAYERCHAT)
|
||||
.Const(_SC("PLAYERCOMMAND"), EVT_PLAYERCOMMAND)
|
||||
.Const(_SC("PLAYERMESSAGE"), EVT_PLAYERMESSAGE)
|
||||
.Const(_SC("PLAYERHEALTH"), EVT_PLAYERHEALTH)
|
||||
.Const(_SC("PLAYERARMOUR"), EVT_PLAYERARMOUR)
|
||||
.Const(_SC("PLAYERWEAPON"), EVT_PLAYERWEAPON)
|
||||
.Const(_SC("PLAYERMOVE"), EVT_PLAYERMOVE)
|
||||
.Const(_SC("PLAYERWASTED"), EVT_PLAYERWASTED)
|
||||
.Const(_SC("PLAYERKILLED"), EVT_PLAYERKILLED)
|
||||
.Const(_SC("PLAYERTEAMKILL"), EVT_PLAYERTEAMKILL)
|
||||
.Const(_SC("PLAYERSPECTATE"), EVT_PLAYERSPECTATE)
|
||||
.Const(_SC("PLAYERCRASHREPORT"), EVT_PLAYERCRASHREPORT)
|
||||
.Const(_SC("PLAYERBURNING"), EVT_PLAYERBURNING)
|
||||
.Const(_SC("PLAYERCROUCHING"), EVT_PLAYERCROUCHING)
|
||||
.Const(_SC("PLAYERSTATE"), EVT_PLAYERSTATE)
|
||||
.Const(_SC("PLAYERACTION"), EVT_PLAYERACTION)
|
||||
.Const(_SC("STATENONE"), EVT_STATENONE)
|
||||
.Const(_SC("STATENORMAL"), EVT_STATENORMAL)
|
||||
.Const(_SC("STATESHOOTING"), EVT_STATESHOOTING)
|
||||
.Const(_SC("STATEDRIVER"), EVT_STATEDRIVER)
|
||||
.Const(_SC("STATEPASSENGER"), EVT_STATEPASSENGER)
|
||||
.Const(_SC("STATEENTERDRIVER"), EVT_STATEENTERDRIVER)
|
||||
.Const(_SC("STATEENTERPASSENGER"), EVT_STATEENTERPASSENGER)
|
||||
.Const(_SC("STATEEXITVEHICLE"), EVT_STATEEXITVEHICLE)
|
||||
.Const(_SC("STATEUNSPAWNED"), EVT_STATEUNSPAWNED)
|
||||
.Const(_SC("ACTIONNONE"), EVT_ACTIONNONE)
|
||||
.Const(_SC("ACTIONNORMAL"), EVT_ACTIONNORMAL)
|
||||
.Const(_SC("ACTIONAIMING"), EVT_ACTIONAIMING)
|
||||
.Const(_SC("ACTIONSHOOTING"), EVT_ACTIONSHOOTING)
|
||||
.Const(_SC("ACTIONJUMPING"), EVT_ACTIONJUMPING)
|
||||
.Const(_SC("ACTIONLIEDOWN"), EVT_ACTIONLIEDOWN)
|
||||
.Const(_SC("ACTIONGETTINGUP"), EVT_ACTIONGETTINGUP)
|
||||
.Const(_SC("ACTIONJUMPVEHICLE"), EVT_ACTIONJUMPVEHICLE)
|
||||
.Const(_SC("ACTIONDRIVING"), EVT_ACTIONDRIVING)
|
||||
.Const(_SC("ACTIONDYING"), EVT_ACTIONDYING)
|
||||
.Const(_SC("ACTIONWASTED"), EVT_ACTIONWASTED)
|
||||
.Const(_SC("ACTIONEMBARKING"), EVT_ACTIONEMBARKING)
|
||||
.Const(_SC("ACTIONDISEMBARKING"), EVT_ACTIONDISEMBARKING)
|
||||
.Const(_SC("VEHICLERESPAWN"), EVT_VEHICLERESPAWN)
|
||||
.Const(_SC("VEHICLEEXPLODE"), EVT_VEHICLEEXPLODE)
|
||||
.Const(_SC("VEHICLEHEALTH"), EVT_VEHICLEHEALTH)
|
||||
.Const(_SC("VEHICLEMOVE"), EVT_VEHICLEMOVE)
|
||||
.Const(_SC("PICKUPRESPAWN"), EVT_PICKUPRESPAWN)
|
||||
.Const(_SC("KEYBINDKEYPRESS"), EVT_KEYBINDKEYPRESS)
|
||||
.Const(_SC("KEYBINDKEYRELEASE"), EVT_KEYBINDKEYRELEASE)
|
||||
.Const(_SC("VEHICLEEMBARKING"), EVT_VEHICLEEMBARKING)
|
||||
.Const(_SC("VEHICLEEMBARKED"), EVT_VEHICLEEMBARKED)
|
||||
.Const(_SC("VEHICLEDISEMBARK"), EVT_VEHICLEDISEMBARK)
|
||||
.Const(_SC("PICKUPCLAIMED"), EVT_PICKUPCLAIMED)
|
||||
.Const(_SC("PICKUPCOLLECTED"), EVT_PICKUPCOLLECTED)
|
||||
.Const(_SC("OBJECTSHOT"), EVT_OBJECTSHOT)
|
||||
.Const(_SC("OBJECTBUMP"), EVT_OBJECTBUMP)
|
||||
.Const(_SC("CHECKPOINTENTERED"), EVT_CHECKPOINTENTERED)
|
||||
.Const(_SC("CHECKPOINTEXITED"), EVT_CHECKPOINTEXITED)
|
||||
.Const(_SC("SPHEREENTERED"), EVT_SPHEREENTERED)
|
||||
.Const(_SC("SPHEREEXITED"), EVT_SPHEREEXITED)
|
||||
.Const(_SC("SERVERFRAME"), EVT_SERVERFRAME)
|
||||
.Const(_SC("SERVERSTARTUP"), EVT_SERVERSTARTUP)
|
||||
.Const(_SC("SERVERSHUTDOWN"), EVT_SERVERSHUTDOWN)
|
||||
.Const(_SC("INTERNALCOMMAND"), EVT_INTERNALCOMMAND)
|
||||
.Const(_SC("LOGINATTEMPT"), EVT_LOGINATTEMPT)
|
||||
.Const(_SC("CUSTOMEVENT"), EVT_CUSTOMEVENT)
|
||||
.Const(_SC("WORLDOPTION"), EVT_WORLDOPTION)
|
||||
.Const(_SC("WORLDTOGGLE"), EVT_WORLDTOGGLE)
|
||||
.Const(_SC("SCRIPTRELOAD"), EVT_SCRIPTRELOAD)
|
||||
.Const(_SC("COUNT"), EVT_COUNT)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("ECREATEREASON"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("DEFAULT"), SQMOD_CREATE_DEFAULT)
|
||||
.Const(_SC("MANUAL"), SQMOD_CREATE_MANUAL)
|
||||
.Const(_SC("POOL"), SQMOD_CREATE_POOL)
|
||||
.Const(_SC("AUTOMATIC"), SQMOD_CREATE_AUTOMATIC)
|
||||
.Const(_SC("OVERWRITE"), SQMOD_CREATE_OVERWRITE)
|
||||
.Const(_SC("RESURECT"), SQMOD_CREATE_RESURECT)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EDESTROYREASON"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("DEFAULT"), SQMOD_DESTROY_DEFAULT)
|
||||
.Const(_SC("MANUAL"), SQMOD_DESTROY_MANUAL)
|
||||
.Const(_SC("POOL"), SQMOD_DESTROY_POOL)
|
||||
.Const(_SC("AUTOMATIC"), SQMOD_DESTROY_AUTOMATIC)
|
||||
.Const(_SC("OVERWRITE"), SQMOD_DESTROY_OVERWRITE)
|
||||
.Const(_SC("CLEANUP"), SQMOD_DESTROY_CLEANUP)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EENTITYPOOLUPD"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("VEHICLE"), SQMOD_ENTITY_POOL_VEHICLE)
|
||||
.Const(_SC("OBJECT"), SQMOD_ENTITY_POOL_OBJECT)
|
||||
.Const(_SC("PICKUP"), SQMOD_ENTITY_POOL_PICKUP)
|
||||
.Const(_SC("RADIO"), SQMOD_ENTITY_POOL_RADIO)
|
||||
.Const(_SC("SPRITE"), SQMOD_ENTITY_POOL_SPRITE)
|
||||
.Const(_SC("TEXTDRAW"), SQMOD_ENTITY_POOL_TEXTDRAW)
|
||||
.Const(_SC("BLIP"), SQMOD_ENTITY_POOL_BLIP)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EVEHICLEUPD"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("DRIVER"), SQMOD_VEHICLEUPD_DRIVER)
|
||||
.Const(_SC("OTHER"), SQMOD_VEHICLEUPD_OTHER)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EPLAYERUPD"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("ONFOOT"), SQMOD_PLAYERUPD_ONFOOT)
|
||||
.Const(_SC("AIM"), SQMOD_PLAYERUPD_AIM)
|
||||
.Const(_SC("DRIVER"), SQMOD_PLAYERUPD_DRIVER)
|
||||
.Const(_SC("PASSENGER"), SQMOD_PLAYERUPD_PASSENGER)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EPARTREASON"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("TIMEOUT"), SQMOD_PARTREASON_TIMEOUT)
|
||||
.Const(_SC("DISCONNECTED"), SQMOD_PARTREASON_DISCONNECTED)
|
||||
.Const(_SC("KICKEDBANNED"), SQMOD_PARTREASON_KICKEDBANNED)
|
||||
.Const(_SC("CRASHED"), SQMOD_PARTREASON_CRASHED)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EBODYPART"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("BODY"), SQMOD_BODYPART_BODY)
|
||||
.Const(_SC("TORSO"), SQMOD_BODYPART_TORSO)
|
||||
.Const(_SC("LEFTARM"), SQMOD_BODYPART_LEFTARM)
|
||||
.Const(_SC("LARM"), SQMOD_BODYPART_LEFTARM)
|
||||
.Const(_SC("RIGHTARM"), SQMOD_BODYPART_RIGHTARM)
|
||||
.Const(_SC("RARM"), SQMOD_BODYPART_RIGHTARM)
|
||||
.Const(_SC("LEFTLEG"), SQMOD_BODYPART_LEFTLEG)
|
||||
.Const(_SC("LLEG"), SQMOD_BODYPART_LEFTLEG)
|
||||
.Const(_SC("RIGHTLEG"), SQMOD_BODYPART_RIGHTLEG)
|
||||
.Const(_SC("RLEG"), SQMOD_BODYPART_RIGHTLEG)
|
||||
.Const(_SC("HEAD"), SQMOD_BODYPART_HEAD)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EPLAYERSTATE"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("NONE"), SQMOD_PLAYER_STATE_NONE)
|
||||
.Const(_SC("NORMAL"), SQMOD_PLAYER_STATE_NORMAL)
|
||||
.Const(_SC("SHOOTING"), SQMOD_PLAYER_STATE_SHOOTING)
|
||||
.Const(_SC("DRIVER"), SQMOD_PLAYER_STATE_DRIVER)
|
||||
.Const(_SC("PASSENGER"), SQMOD_PLAYER_STATE_PASSENGER)
|
||||
.Const(_SC("ENTERING_AS_DRIVER"), SQMOD_PLAYER_STATE_ENTERING_AS_DRIVER)
|
||||
.Const(_SC("ENTERING_AS_PASSENGER"), SQMOD_PLAYER_STATE_ENTERING_AS_PASSENGER)
|
||||
.Const(_SC("EXITING_VEHICLE"), SQMOD_PLAYER_STATE_EXITING_VEHICLE)
|
||||
.Const(_SC("UNSPAWNED"), SQMOD_PLAYER_STATE_UNSPAWNED)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EPLAYERACTION"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("NONE"), SQMOD_PLAYER_ACTION_NONE)
|
||||
.Const(_SC("NORMAL"), SQMOD_PLAYER_ACTION_NORMAL)
|
||||
.Const(_SC("AIMING"), SQMOD_PLAYER_ACTION_AIMING)
|
||||
.Const(_SC("SHOOTING"), SQMOD_PLAYER_ACTION_SHOOTING)
|
||||
.Const(_SC("JUMPING"), SQMOD_PLAYER_ACTION_JUMPING)
|
||||
.Const(_SC("LYING_ON_GROUND"), SQMOD_PLAYER_ACTION_LYING_ON_GROUND)
|
||||
.Const(_SC("GETTING_UP"), SQMOD_PLAYER_ACTION_GETTING_UP)
|
||||
.Const(_SC("JUMPING_FROM_VEHICLE"), SQMOD_PLAYER_ACTION_JUMPING_FROM_VEHICLE)
|
||||
.Const(_SC("DRIVING"), SQMOD_PLAYER_ACTION_DRIVING)
|
||||
.Const(_SC("DYING"), SQMOD_PLAYER_ACTION_DYING)
|
||||
.Const(_SC("WASTED"), SQMOD_PLAYER_ACTION_WASTED)
|
||||
.Const(_SC("ENTERING_VEHICLE"), SQMOD_PLAYER_ACTION_ENTERING_VEHICLE)
|
||||
.Const(_SC("EXITING_VEHICLE"), SQMOD_PLAYER_ACTION_EXITING_VEHICLE)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EWEATHER"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("MOSTLYCLEAR"), SQMOD_WEATHER_MOSTLYCLEAR)
|
||||
.Const(_SC("OVERCAST"), SQMOD_WEATHER_OVERCAST)
|
||||
.Const(_SC("THUNDERSTORM"), SQMOD_WEATHER_THUNDERSTORM)
|
||||
.Const(_SC("STORM"), SQMOD_WEATHER_STORM)
|
||||
.Const(_SC("STORMY"), SQMOD_WEATHER_STORMY)
|
||||
.Const(_SC("FOGGY"), SQMOD_WEATHER_FOGGY)
|
||||
.Const(_SC("FOG"), SQMOD_WEATHER_FOG)
|
||||
.Const(_SC("CLEAR"), SQMOD_WEATHER_CLEAR)
|
||||
.Const(_SC("SUNNY"), SQMOD_WEATHER_SUNNY)
|
||||
.Const(_SC("RAIN"), SQMOD_WEATHER_RAIN)
|
||||
.Const(_SC("RAINY"), SQMOD_WEATHER_RAINY)
|
||||
.Const(_SC("DARKCLOUDY"), SQMOD_WEATHER_DARKCLOUDY)
|
||||
.Const(_SC("LIGHTCLOUDY"), SQMOD_WEATHER_LIGHTCLOUDY)
|
||||
.Const(_SC("OVERCASTCLOUDY"), SQMOD_WEATHER_OVERCASTCLOUDY)
|
||||
.Const(_SC("BLACKCLOUDS"), SQMOD_WEATHER_BLACKCLOUDS)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EWEAPON"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNWON"), SQMOD_UNKNOWN)
|
||||
.Const(_SC("UNARMED"), SQMOD_WEAPON_UNARMED)
|
||||
.Const(_SC("BRASSKNUCKLES"), SQMOD_WEAPON_BRASSKNUCKLES)
|
||||
.Const(_SC("SCREWDRIVER"), SQMOD_WEAPON_SCREWDRIVER)
|
||||
.Const(_SC("GOLFCLUB"), SQMOD_WEAPON_GOLFCLUB)
|
||||
.Const(_SC("NIGHTSTICK"), SQMOD_WEAPON_NIGHTSTICK)
|
||||
.Const(_SC("KNIFE"), SQMOD_WEAPON_KNIFE)
|
||||
.Const(_SC("BASEBALLBAT"), SQMOD_WEAPON_BASEBALLBAT)
|
||||
.Const(_SC("HAMMER"), SQMOD_WEAPON_HAMMER)
|
||||
.Const(_SC("MEATCLEAVER"), SQMOD_WEAPON_MEATCLEAVER)
|
||||
.Const(_SC("MACHETE"), SQMOD_WEAPON_MACHETE)
|
||||
.Const(_SC("KATANA"), SQMOD_WEAPON_KATANA)
|
||||
.Const(_SC("CHAINSAW"), SQMOD_WEAPON_CHAINSAW)
|
||||
.Const(_SC("GRENADE"), SQMOD_WEAPON_GRENADE)
|
||||
.Const(_SC("REMOTE"), SQMOD_WEAPON_REMOTE)
|
||||
.Const(_SC("TEARGAS"), SQMOD_WEAPON_TEARGAS)
|
||||
.Const(_SC("MOLOTOV"), SQMOD_WEAPON_MOLOTOV)
|
||||
.Const(_SC("ROCKET"), SQMOD_WEAPON_ROCKET)
|
||||
.Const(_SC("COLT45"), SQMOD_WEAPON_COLT45)
|
||||
.Const(_SC("PYTHON"), SQMOD_WEAPON_PYTHON)
|
||||
.Const(_SC("SHOTGUN"), SQMOD_WEAPON_SHOTGUN)
|
||||
.Const(_SC("SPAS12"), SQMOD_WEAPON_SPAS12)
|
||||
.Const(_SC("STUBBY"), SQMOD_WEAPON_STUBBY)
|
||||
.Const(_SC("TEC9"), SQMOD_WEAPON_TEC9)
|
||||
.Const(_SC("UZI"), SQMOD_WEAPON_UZI)
|
||||
.Const(_SC("INGRAM"), SQMOD_WEAPON_INGRAM)
|
||||
.Const(_SC("MP5"), SQMOD_WEAPON_MP5)
|
||||
.Const(_SC("M4"), SQMOD_WEAPON_M4)
|
||||
.Const(_SC("RUGER"), SQMOD_WEAPON_RUGER)
|
||||
.Const(_SC("SNIPER"), SQMOD_WEAPON_SNIPER)
|
||||
.Const(_SC("LASERSCOPE"), SQMOD_WEAPON_LASERSCOPE)
|
||||
.Const(_SC("ROCKETLAUNCHER"), SQMOD_WEAPON_ROCKETLAUNCHER)
|
||||
.Const(_SC("FLAMETHROWER"), SQMOD_WEAPON_FLAMETHROWER)
|
||||
.Const(_SC("M60"), SQMOD_WEAPON_M60)
|
||||
.Const(_SC("MINIGUN"), SQMOD_WEAPON_MINIGUN)
|
||||
.Const(_SC("BOMB"), SQMOD_WEAPON_BOMB)
|
||||
.Const(_SC("HELICANNON"), SQMOD_WEAPON_HELICANNON)
|
||||
.Const(_SC("CAMERA"), SQMOD_WEAPON_CAMERA)
|
||||
.Const(_SC("VEHICLE"), SQMOD_WEAPON_VEHICLE)
|
||||
.Const(_SC("EXPLOSION1"), SQMOD_WEAPON_EXPLOSION1)
|
||||
.Const(_SC("DRIVEBY"), SQMOD_WEAPON_DRIVEBY)
|
||||
.Const(_SC("DROWNED"), SQMOD_WEAPON_DROWNED)
|
||||
.Const(_SC("FALL"), SQMOD_WEAPON_FALL)
|
||||
.Const(_SC("EXPLOSION2"), SQMOD_WEAPON_EXPLOSION2)
|
||||
.Const(_SC("SUICIDE"), SQMOD_WEAPON_SUICIDE)
|
||||
.Const(_SC("ROCKET"), SQMOD_WEAPON_ROCKETLAUNCHER)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EVEHICLE"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNOWN"), SQMOD_UNKNOWN)
|
||||
.Const(_SC("LANDSTALKER"), SQMOD_VEHICLE_LANDSTALKER)
|
||||
.Const(_SC("IDAHO"), SQMOD_VEHICLE_IDAHO)
|
||||
.Const(_SC("STINGER"), SQMOD_VEHICLE_STINGER)
|
||||
.Const(_SC("LINERUNNER"), SQMOD_VEHICLE_LINERUNNER)
|
||||
.Const(_SC("PERENNIAL"), SQMOD_VEHICLE_PERENNIAL)
|
||||
.Const(_SC("SENTINEL"), SQMOD_VEHICLE_SENTINEL)
|
||||
.Const(_SC("RIO"), SQMOD_VEHICLE_RIO)
|
||||
.Const(_SC("FIRETRUCK"), SQMOD_VEHICLE_FIRETRUCK)
|
||||
.Const(_SC("TRASHMASTER"), SQMOD_VEHICLE_TRASHMASTER)
|
||||
.Const(_SC("STRETCH"), SQMOD_VEHICLE_STRETCH)
|
||||
.Const(_SC("MANANA"), SQMOD_VEHICLE_MANANA)
|
||||
.Const(_SC("INFERNUS"), SQMOD_VEHICLE_INFERNUS)
|
||||
.Const(_SC("VOODOO"), SQMOD_VEHICLE_VOODOO)
|
||||
.Const(_SC("PONY"), SQMOD_VEHICLE_PONY)
|
||||
.Const(_SC("MULE"), SQMOD_VEHICLE_MULE)
|
||||
.Const(_SC("CHEETAH"), SQMOD_VEHICLE_CHEETAH)
|
||||
.Const(_SC("AMBULANCE"), SQMOD_VEHICLE_AMBULANCE)
|
||||
.Const(_SC("FBIWASHINGTON"), SQMOD_VEHICLE_FBIWASHINGTON)
|
||||
.Const(_SC("MOONBEAM"), SQMOD_VEHICLE_MOONBEAM)
|
||||
.Const(_SC("ESPERANTO"), SQMOD_VEHICLE_ESPERANTO)
|
||||
.Const(_SC("TAXI"), SQMOD_VEHICLE_TAXI)
|
||||
.Const(_SC("WASHINGTON"), SQMOD_VEHICLE_WASHINGTON)
|
||||
.Const(_SC("BOBCAT"), SQMOD_VEHICLE_BOBCAT)
|
||||
.Const(_SC("MRWHOOPEE"), SQMOD_VEHICLE_MRWHOOPEE)
|
||||
.Const(_SC("BFINJECTION"), SQMOD_VEHICLE_BFINJECTION)
|
||||
.Const(_SC("HUNTER"), SQMOD_VEHICLE_HUNTER)
|
||||
.Const(_SC("POLICE"), SQMOD_VEHICLE_POLICE)
|
||||
.Const(_SC("ENFORCER"), SQMOD_VEHICLE_ENFORCER)
|
||||
.Const(_SC("SECURICAR"), SQMOD_VEHICLE_SECURICAR)
|
||||
.Const(_SC("BANSHEE"), SQMOD_VEHICLE_BANSHEE)
|
||||
.Const(_SC("PREDATOR"), SQMOD_VEHICLE_PREDATOR)
|
||||
.Const(_SC("BUS"), SQMOD_VEHICLE_BUS)
|
||||
.Const(_SC("RHINO"), SQMOD_VEHICLE_RHINO)
|
||||
.Const(_SC("BARRACKSOL"), SQMOD_VEHICLE_BARRACKSOL)
|
||||
.Const(_SC("BARRACKS"), SQMOD_VEHICLE_BARRACKS)
|
||||
.Const(_SC("CUBANHERMES"), SQMOD_VEHICLE_CUBANHERMES)
|
||||
.Const(_SC("HELICOPTER"), SQMOD_VEHICLE_HELICOPTER)
|
||||
.Const(_SC("ANGEL"), SQMOD_VEHICLE_ANGEL)
|
||||
.Const(_SC("COACH"), SQMOD_VEHICLE_COACH)
|
||||
.Const(_SC("CABBIE"), SQMOD_VEHICLE_CABBIE)
|
||||
.Const(_SC("STALLION"), SQMOD_VEHICLE_STALLION)
|
||||
.Const(_SC("RUMPO"), SQMOD_VEHICLE_RUMPO)
|
||||
.Const(_SC("RCBANDIT"), SQMOD_VEHICLE_RCBANDIT)
|
||||
.Const(_SC("HEARSE"), SQMOD_VEHICLE_HEARSE)
|
||||
.Const(_SC("PACKER"), SQMOD_VEHICLE_PACKER)
|
||||
.Const(_SC("SENTINELXS"), SQMOD_VEHICLE_SENTINELXS)
|
||||
.Const(_SC("ADMIRAL"), SQMOD_VEHICLE_ADMIRAL)
|
||||
.Const(_SC("SQUALO"), SQMOD_VEHICLE_SQUALO)
|
||||
.Const(_SC("SEASPARROW"), SQMOD_VEHICLE_SEASPARROW)
|
||||
.Const(_SC("PIZZABOY"), SQMOD_VEHICLE_PIZZABOY)
|
||||
.Const(_SC("GANGBURRITO"), SQMOD_VEHICLE_GANGBURRITO)
|
||||
.Const(_SC("AIRTRAIN"), SQMOD_VEHICLE_AIRTRAIN)
|
||||
.Const(_SC("DEADDODO"), SQMOD_VEHICLE_DEADDODO)
|
||||
.Const(_SC("SPEEDER"), SQMOD_VEHICLE_SPEEDER)
|
||||
.Const(_SC("REEFER"), SQMOD_VEHICLE_REEFER)
|
||||
.Const(_SC("TROPIC"), SQMOD_VEHICLE_TROPIC)
|
||||
.Const(_SC("FLATBED"), SQMOD_VEHICLE_FLATBED)
|
||||
.Const(_SC("YANKEE"), SQMOD_VEHICLE_YANKEE)
|
||||
.Const(_SC("CADDY"), SQMOD_VEHICLE_CADDY)
|
||||
.Const(_SC("ZEBRA"), SQMOD_VEHICLE_ZEBRA)
|
||||
.Const(_SC("ZEBRACAB"), SQMOD_VEHICLE_ZEBRACAB)
|
||||
.Const(_SC("TOPFUN"), SQMOD_VEHICLE_TOPFUN)
|
||||
.Const(_SC("SKIMMER"), SQMOD_VEHICLE_SKIMMER)
|
||||
.Const(_SC("PCJ600"), SQMOD_VEHICLE_PCJ600)
|
||||
.Const(_SC("PCJ"), SQMOD_VEHICLE_PCJ)
|
||||
.Const(_SC("FAGGIO"), SQMOD_VEHICLE_FAGGIO)
|
||||
.Const(_SC("FREEWAY"), SQMOD_VEHICLE_FREEWAY)
|
||||
.Const(_SC("RCBARON"), SQMOD_VEHICLE_RCBARON)
|
||||
.Const(_SC("RCRAIDER"), SQMOD_VEHICLE_RCRAIDER)
|
||||
.Const(_SC("GLENDALE"), SQMOD_VEHICLE_GLENDALE)
|
||||
.Const(_SC("OCEANIC"), SQMOD_VEHICLE_OCEANIC)
|
||||
.Const(_SC("SANCHEZ"), SQMOD_VEHICLE_SANCHEZ)
|
||||
.Const(_SC("SPARROW"), SQMOD_VEHICLE_SPARROW)
|
||||
.Const(_SC("PATRIOT"), SQMOD_VEHICLE_PATRIOT)
|
||||
.Const(_SC("LOVEFIST"), SQMOD_VEHICLE_LOVEFIST)
|
||||
.Const(_SC("COASTGUARD"), SQMOD_VEHICLE_COASTGUARD)
|
||||
.Const(_SC("DINGHY"), SQMOD_VEHICLE_DINGHY)
|
||||
.Const(_SC("HERMES"), SQMOD_VEHICLE_HERMES)
|
||||
.Const(_SC("SABRE"), SQMOD_VEHICLE_SABRE)
|
||||
.Const(_SC("SABRETURBO"), SQMOD_VEHICLE_SABRETURBO)
|
||||
.Const(_SC("PHOENIX"), SQMOD_VEHICLE_PHOENIX)
|
||||
.Const(_SC("WALTON"), SQMOD_VEHICLE_WALTON)
|
||||
.Const(_SC("REGINA"), SQMOD_VEHICLE_REGINA)
|
||||
.Const(_SC("COMET"), SQMOD_VEHICLE_COMET)
|
||||
.Const(_SC("DELUXO"), SQMOD_VEHICLE_DELUXO)
|
||||
.Const(_SC("BURRITO"), SQMOD_VEHICLE_BURRITO)
|
||||
.Const(_SC("SPANDEX"), SQMOD_VEHICLE_SPANDEX)
|
||||
.Const(_SC("SPANDEXPRESS"), SQMOD_VEHICLE_SPANDEXPRESS)
|
||||
.Const(_SC("MARQUIS"), SQMOD_VEHICLE_MARQUIS)
|
||||
.Const(_SC("BAGGAGE"), SQMOD_VEHICLE_BAGGAGE)
|
||||
.Const(_SC("BAGGAGEHANDLER"), SQMOD_VEHICLE_BAGGAGEHANDLER)
|
||||
.Const(_SC("KAUFMAN"), SQMOD_VEHICLE_KAUFMAN)
|
||||
.Const(_SC("KAUFMANCAB"), SQMOD_VEHICLE_KAUFMANCAB)
|
||||
.Const(_SC("MAVERICK"), SQMOD_VEHICLE_MAVERICK)
|
||||
.Const(_SC("VCNMAVERICK"), SQMOD_VEHICLE_VCNMAVERICK)
|
||||
.Const(_SC("RANCHER"), SQMOD_VEHICLE_RANCHER)
|
||||
.Const(_SC("FBIRANCHER"), SQMOD_VEHICLE_FBIRANCHER)
|
||||
.Const(_SC("VIRGO"), SQMOD_VEHICLE_VIRGO)
|
||||
.Const(_SC("GREENWOOD"), SQMOD_VEHICLE_GREENWOOD)
|
||||
.Const(_SC("CUBANJETMAX"), SQMOD_VEHICLE_CUBANJETMAX)
|
||||
.Const(_SC("HOTRING1"), SQMOD_VEHICLE_HOTRING1)
|
||||
.Const(_SC("HOTRINGRACER1"), SQMOD_VEHICLE_HOTRINGRACER1)
|
||||
.Const(_SC("SANDKING"), SQMOD_VEHICLE_SANDKING)
|
||||
.Const(_SC("BLISTA"), SQMOD_VEHICLE_BLISTA)
|
||||
.Const(_SC("BLISTAC"), SQMOD_VEHICLE_BLISTAC)
|
||||
.Const(_SC("BLISTACOMPACT"), SQMOD_VEHICLE_BLISTACOMPACT)
|
||||
.Const(_SC("COMPACT"), SQMOD_VEHICLE_COMPACT)
|
||||
.Const(_SC("POLICEMAV"), SQMOD_VEHICLE_POLICEMAV)
|
||||
.Const(_SC("POLICEMAVERICK"), SQMOD_VEHICLE_POLICEMAVERICK)
|
||||
.Const(_SC("BOXVILLE"), SQMOD_VEHICLE_BOXVILLE)
|
||||
.Const(_SC("BENSON"), SQMOD_VEHICLE_BENSON)
|
||||
.Const(_SC("MESA"), SQMOD_VEHICLE_MESA)
|
||||
.Const(_SC("MESAGRANDE"), SQMOD_VEHICLE_MESAGRANDE)
|
||||
.Const(_SC("RCGOBLIN"), SQMOD_VEHICLE_RCGOBLIN)
|
||||
.Const(_SC("HOTRING2"), SQMOD_VEHICLE_HOTRING2)
|
||||
.Const(_SC("HOTRINGRACER2"), SQMOD_VEHICLE_HOTRINGRACER2)
|
||||
.Const(_SC("HOTRING3"), SQMOD_VEHICLE_HOTRING3)
|
||||
.Const(_SC("HOTRINGRACER3"), SQMOD_VEHICLE_HOTRINGRACER3)
|
||||
.Const(_SC("BLOODRING1"), SQMOD_VEHICLE_BLOODRING1)
|
||||
.Const(_SC("BLOODRINGBANGER1"), SQMOD_VEHICLE_BLOODRINGBANGER1)
|
||||
.Const(_SC("BLOODRING2"), SQMOD_VEHICLE_BLOODRING2)
|
||||
.Const(_SC("BLOODRINGBANGER2"), SQMOD_VEHICLE_BLOODRINGBANGER2)
|
||||
.Const(_SC("VICECHEE"), SQMOD_VEHICLE_VICECHEE)
|
||||
.Const(_SC("POLICECHEETAH"), SQMOD_VEHICLE_POLICECHEETAH)
|
||||
.Const(_SC("FBICHEETAH"), SQMOD_VEHICLE_FBICHEETAH)
|
||||
.Const(_SC("CHEETAH2"), SQMOD_VEHICLE_CHEETAH2)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("ESKIN"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("UNKNOWN"), SQMOD_UNKNOWN)
|
||||
.Const(_SC("TOMMY_VERCETTI"), SQMOD_SKIN_TOMMY_VERCETTI)
|
||||
.Const(_SC("COP"), SQMOD_SKIN_COP)
|
||||
.Const(_SC("SWAT"), SQMOD_SKIN_SWAT)
|
||||
.Const(_SC("FBI"), SQMOD_SKIN_FBI)
|
||||
.Const(_SC("ARMY"), SQMOD_SKIN_ARMY)
|
||||
.Const(_SC("PARAMEDIC"), SQMOD_SKIN_PARAMEDIC)
|
||||
.Const(_SC("FIREMAN"), SQMOD_SKIN_FIREMAN)
|
||||
.Const(_SC("GOLF_GUY_A"), SQMOD_SKIN_GOLF_GUY_A)
|
||||
.Const(_SC("BUM_LADY_A"), SQMOD_SKIN_BUM_LADY_A)
|
||||
.Const(_SC("BUM_LADY_B"), SQMOD_SKIN_BUM_LADY_B)
|
||||
.Const(_SC("PUNK_A"), SQMOD_SKIN_PUNK_A)
|
||||
.Const(_SC("LAWYER"), SQMOD_SKIN_LAWYER)
|
||||
.Const(_SC("SPANISH_LADY_A"), SQMOD_SKIN_SPANISH_LADY_A)
|
||||
.Const(_SC("SPANISH_LADY_B"), SQMOD_SKIN_SPANISH_LADY_B)
|
||||
.Const(_SC("COOL_GUY_A"), SQMOD_SKIN_COOL_GUY_A)
|
||||
.Const(_SC("ARABIC_GUY"), SQMOD_SKIN_ARABIC_GUY)
|
||||
.Const(_SC("BEACH_LADY_A"), SQMOD_SKIN_BEACH_LADY_A)
|
||||
.Const(_SC("BEACH_LADY_B"), SQMOD_SKIN_BEACH_LADY_B)
|
||||
.Const(_SC("BEACH_GUY_A"), SQMOD_SKIN_BEACH_GUY_A)
|
||||
.Const(_SC("BEACH_GUY_B"), SQMOD_SKIN_BEACH_GUY_B)
|
||||
.Const(_SC("OFFICE_LADY_A"), SQMOD_SKIN_OFFICE_LADY_A)
|
||||
.Const(_SC("WAITRESS_A"), SQMOD_SKIN_WAITRESS_A)
|
||||
.Const(_SC("FOOD_LADY"), SQMOD_SKIN_FOOD_LADY)
|
||||
.Const(_SC("PROSTITUTE_A"), SQMOD_SKIN_PROSTITUTE_A)
|
||||
.Const(_SC("BUM_LADY_C"), SQMOD_SKIN_BUM_LADY_C)
|
||||
.Const(_SC("BUM_GUY_A"), SQMOD_SKIN_BUM_GUY_A)
|
||||
.Const(_SC("GARBAGEMAN_A"), SQMOD_SKIN_GARBAGEMAN_A)
|
||||
.Const(_SC("TAXI_DRIVER_A"), SQMOD_SKIN_TAXI_DRIVER_A)
|
||||
.Const(_SC("HATIAN_A"), SQMOD_SKIN_HATIAN_A)
|
||||
.Const(_SC("CRIMINAL_A"), SQMOD_SKIN_CRIMINAL_A)
|
||||
.Const(_SC("HOOD_LADY"), SQMOD_SKIN_HOOD_LADY)
|
||||
.Const(_SC("GRANNY_A"), SQMOD_SKIN_GRANNY_A)
|
||||
.Const(_SC("BUSINESS_MAN_A"), SQMOD_SKIN_BUSINESS_MAN_A)
|
||||
.Const(_SC("CHURCH_GUY"), SQMOD_SKIN_CHURCH_GUY)
|
||||
.Const(_SC("CLUB_LADY"), SQMOD_SKIN_CLUB_LADY)
|
||||
.Const(_SC("CHURCH_LADY"), SQMOD_SKIN_CHURCH_LADY)
|
||||
.Const(_SC("PIMP"), SQMOD_SKIN_PIMP)
|
||||
.Const(_SC("BEACH_LADY_C"), SQMOD_SKIN_BEACH_LADY_C)
|
||||
.Const(_SC("BEACH_GUY_C"), SQMOD_SKIN_BEACH_GUY_C)
|
||||
.Const(_SC("BEACH_LADY_D"), SQMOD_SKIN_BEACH_LADY_D)
|
||||
.Const(_SC("BEACH_GUY_D"), SQMOD_SKIN_BEACH_GUY_D)
|
||||
.Const(_SC("BUSINESS_MAN_B"), SQMOD_SKIN_BUSINESS_MAN_B)
|
||||
.Const(_SC("PROSTITUTE_B"), SQMOD_SKIN_PROSTITUTE_B)
|
||||
.Const(_SC("BUM_LADY_D"), SQMOD_SKIN_BUM_LADY_D)
|
||||
.Const(_SC("BUM_GUY_B"), SQMOD_SKIN_BUM_GUY_B)
|
||||
.Const(_SC("HATIAN_B"), SQMOD_SKIN_HATIAN_B)
|
||||
.Const(_SC("CONSTRUCTION_WORKER_A"), SQMOD_SKIN_CONSTRUCTION_WORKER_A)
|
||||
.Const(_SC("PUNK_B"), SQMOD_SKIN_PUNK_B)
|
||||
.Const(_SC("PROSTITUTE_C"), SQMOD_SKIN_PROSTITUTE_C)
|
||||
.Const(_SC("GRANNY_B"), SQMOD_SKIN_GRANNY_B)
|
||||
.Const(_SC("PUNK_C"), SQMOD_SKIN_PUNK_C)
|
||||
.Const(_SC("BUSINESS_MAN_C"), SQMOD_SKIN_BUSINESS_MAN_C)
|
||||
.Const(_SC("SPANISH_LADY_C"), SQMOD_SKIN_SPANISH_LADY_C)
|
||||
.Const(_SC("SPANISH_LADY_D"), SQMOD_SKIN_SPANISH_LADY_D)
|
||||
.Const(_SC("COOL_GUY_B"), SQMOD_SKIN_COOL_GUY_B)
|
||||
.Const(_SC("BUSINESS_MAN_D"), SQMOD_SKIN_BUSINESS_MAN_D)
|
||||
.Const(_SC("BEACH_LADY_E"), SQMOD_SKIN_BEACH_LADY_E)
|
||||
.Const(_SC("BEACH_GUY_E"), SQMOD_SKIN_BEACH_GUY_E)
|
||||
.Const(_SC("BEACH_LADY_F"), SQMOD_SKIN_BEACH_LADY_F)
|
||||
.Const(_SC("BEACH_GUY_F"), SQMOD_SKIN_BEACH_GUY_F)
|
||||
.Const(_SC("CONSTRUCTION_WORKER_B"), SQMOD_SKIN_CONSTRUCTION_WORKER_B)
|
||||
.Const(_SC("GOLF_GUY_B"), SQMOD_SKIN_GOLF_GUY_B)
|
||||
.Const(_SC("GOLF_LADY"), SQMOD_SKIN_GOLF_LADY)
|
||||
.Const(_SC("GOLF_GUY_C"), SQMOD_SKIN_GOLF_GUY_C)
|
||||
.Const(_SC("BEACH_LADY_G"), SQMOD_SKIN_BEACH_LADY_G)
|
||||
.Const(_SC("BEACH_GUY_G"), SQMOD_SKIN_BEACH_GUY_G)
|
||||
.Const(_SC("OFFICE_LADY_B"), SQMOD_SKIN_OFFICE_LADY_B)
|
||||
.Const(_SC("BUSINESS_MAN_E"), SQMOD_SKIN_BUSINESS_MAN_E)
|
||||
.Const(_SC("BUSINESS_MAN_F"), SQMOD_SKIN_BUSINESS_MAN_F)
|
||||
.Const(_SC("PROSTITUTE_D"), SQMOD_SKIN_PROSTITUTE_D)
|
||||
.Const(_SC("BUM_LADY_E"), SQMOD_SKIN_BUM_LADY_E)
|
||||
.Const(_SC("BUM_GUY_C"), SQMOD_SKIN_BUM_GUY_C)
|
||||
.Const(_SC("SPANISH_GUY"), SQMOD_SKIN_SPANISH_GUY)
|
||||
.Const(_SC("TAXI_DRIVER_B"), SQMOD_SKIN_TAXI_DRIVER_B)
|
||||
.Const(_SC("GYM_LADY"), SQMOD_SKIN_GYM_LADY)
|
||||
.Const(_SC("GYM_GUY"), SQMOD_SKIN_GYM_GUY)
|
||||
.Const(_SC("SKATE_LADY"), SQMOD_SKIN_SKATE_LADY)
|
||||
.Const(_SC("SKATE_GUY"), SQMOD_SKIN_SKATE_GUY)
|
||||
.Const(_SC("SHOPPER_A"), SQMOD_SKIN_SHOPPER_A)
|
||||
.Const(_SC("SHOPPER_B"), SQMOD_SKIN_SHOPPER_B)
|
||||
.Const(_SC("TOURIST_A"), SQMOD_SKIN_TOURIST_A)
|
||||
.Const(_SC("TOURIST_B"), SQMOD_SKIN_TOURIST_B)
|
||||
.Const(_SC("CUBAN_A"), SQMOD_SKIN_CUBAN_A)
|
||||
.Const(_SC("CUBAN_B"), SQMOD_SKIN_CUBAN_B)
|
||||
.Const(_SC("HATIAN_C"), SQMOD_SKIN_HATIAN_C)
|
||||
.Const(_SC("HATIAN_D"), SQMOD_SKIN_HATIAN_D)
|
||||
.Const(_SC("SHARK_A"), SQMOD_SKIN_SHARK_A)
|
||||
.Const(_SC("SHARK_B"), SQMOD_SKIN_SHARK_B)
|
||||
.Const(_SC("DIAZ_GUY_A"), SQMOD_SKIN_DIAZ_GUY_A)
|
||||
.Const(_SC("DIAZ_GUY_B"), SQMOD_SKIN_DIAZ_GUY_B)
|
||||
.Const(_SC("DBP_SECURITY_A"), SQMOD_SKIN_DBP_SECURITY_A)
|
||||
.Const(_SC("DBP_SECURITY_B"), SQMOD_SKIN_DBP_SECURITY_B)
|
||||
.Const(_SC("BIKER_A"), SQMOD_SKIN_BIKER_A)
|
||||
.Const(_SC("BIKER_B"), SQMOD_SKIN_BIKER_B)
|
||||
.Const(_SC("VERCETTI_GUY_A"), SQMOD_SKIN_VERCETTI_GUY_A)
|
||||
.Const(_SC("VERCETTI_GUY_B"), SQMOD_SKIN_VERCETTI_GUY_B)
|
||||
.Const(_SC("UNDERCOVER_COP_A"), SQMOD_SKIN_UNDERCOVER_COP_A)
|
||||
.Const(_SC("UNDERCOVER_COP_B"), SQMOD_SKIN_UNDERCOVER_COP_B)
|
||||
.Const(_SC("UNDERCOVER_COP_C"), SQMOD_SKIN_UNDERCOVER_COP_C)
|
||||
.Const(_SC("UNDERCOVER_COP_D"), SQMOD_SKIN_UNDERCOVER_COP_D)
|
||||
.Const(_SC("UNDERCOVER_COP_E"), SQMOD_SKIN_UNDERCOVER_COP_E)
|
||||
.Const(_SC("UNDERCOVER_COP_F"), SQMOD_SKIN_UNDERCOVER_COP_F)
|
||||
.Const(_SC("RICH_GUY"), SQMOD_SKIN_RICH_GUY)
|
||||
.Const(_SC("COOL_GUY_C"), SQMOD_SKIN_COOL_GUY_C)
|
||||
.Const(_SC("PROSTITUTE_E"), SQMOD_SKIN_PROSTITUTE_E)
|
||||
.Const(_SC("PROSTITUTE_F"), SQMOD_SKIN_PROSTITUTE_F)
|
||||
.Const(_SC("LOVE_FIST_A"), SQMOD_SKIN_LOVE_FIST_A)
|
||||
.Const(_SC("KEN_ROSENBURG"), SQMOD_SKIN_KEN_ROSENBURG)
|
||||
.Const(_SC("CANDY_SUXX"), SQMOD_SKIN_CANDY_SUXX)
|
||||
.Const(_SC("HILARY"), SQMOD_SKIN_HILARY)
|
||||
.Const(_SC("LOVE_FIST_B"), SQMOD_SKIN_LOVE_FIST_B)
|
||||
.Const(_SC("PHIL"), SQMOD_SKIN_PHIL)
|
||||
.Const(_SC("ROCKSTAR_GUY"), SQMOD_SKIN_ROCKSTAR_GUY)
|
||||
.Const(_SC("SONNY"), SQMOD_SKIN_SONNY)
|
||||
.Const(_SC("LANCE_A"), SQMOD_SKIN_LANCE_A)
|
||||
.Const(_SC("MERCADES_A"), SQMOD_SKIN_MERCADES_A)
|
||||
.Const(_SC("LOVE_FIST_C"), SQMOD_SKIN_LOVE_FIST_C)
|
||||
.Const(_SC("ALEX_SRUB"), SQMOD_SKIN_ALEX_SRUB)
|
||||
.Const(_SC("LANCE_COP"), SQMOD_SKIN_LANCE_COP)
|
||||
.Const(_SC("LANCE_B"), SQMOD_SKIN_LANCE_B)
|
||||
.Const(_SC("CORTEZ"), SQMOD_SKIN_CORTEZ)
|
||||
.Const(_SC("LOVE_FIST_D"), SQMOD_SKIN_LOVE_FIST_D)
|
||||
.Const(_SC("COLUMBIAN_GUY_A"), SQMOD_SKIN_COLUMBIAN_GUY_A)
|
||||
.Const(_SC("HILARY_ROBBER"), SQMOD_SKIN_HILARY_ROBBER)
|
||||
.Const(_SC("MERCADES_B"), SQMOD_SKIN_MERCADES_B)
|
||||
.Const(_SC("CAM"), SQMOD_SKIN_CAM)
|
||||
.Const(_SC("CAM_ROBBER"), SQMOD_SKIN_CAM_ROBBER)
|
||||
.Const(_SC("PHIL_ONE_ARM"), SQMOD_SKIN_PHIL_ONE_ARM)
|
||||
.Const(_SC("PHIL_ROBBER"), SQMOD_SKIN_PHIL_ROBBER)
|
||||
.Const(_SC("COOL_GUY_D"), SQMOD_SKIN_COOL_GUY_D)
|
||||
.Const(_SC("PIZZAMAN"), SQMOD_SKIN_PIZZAMAN)
|
||||
.Const(_SC("TAXI_DRIVER_C"), SQMOD_SKIN_TAXI_DRIVER_C)
|
||||
.Const(_SC("TAXI_DRIVER_D"), SQMOD_SKIN_TAXI_DRIVER_D)
|
||||
.Const(_SC("SAILOR_A"), SQMOD_SKIN_SAILOR_A)
|
||||
.Const(_SC("SAILOR_B"), SQMOD_SKIN_SAILOR_B)
|
||||
.Const(_SC("SAILOR_C"), SQMOD_SKIN_SAILOR_C)
|
||||
.Const(_SC("CHEF"), SQMOD_SKIN_CHEF)
|
||||
.Const(_SC("CRIMINAL_B"), SQMOD_SKIN_CRIMINAL_B)
|
||||
.Const(_SC("FRENCH_GUY"), SQMOD_SKIN_FRENCH_GUY)
|
||||
.Const(_SC("GARBAGEMAN_B"), SQMOD_SKIN_GARBAGEMAN_B)
|
||||
.Const(_SC("HATIAN_E"), SQMOD_SKIN_HATIAN_E)
|
||||
.Const(_SC("WAITRESS_B"), SQMOD_SKIN_WAITRESS_B)
|
||||
.Const(_SC("SONNY_GUY_A"), SQMOD_SKIN_SONNY_GUY_A)
|
||||
.Const(_SC("SONNY_GUY_B"), SQMOD_SKIN_SONNY_GUY_B)
|
||||
.Const(_SC("SONNY_GUY_C"), SQMOD_SKIN_SONNY_GUY_C)
|
||||
.Const(_SC("COLUMBIAN_GUY_B"), SQMOD_SKIN_COLUMBIAN_GUY_B)
|
||||
.Const(_SC("THUG_A"), SQMOD_SKIN_THUG_A)
|
||||
.Const(_SC("BEACH_GUY_H"), SQMOD_SKIN_BEACH_GUY_H)
|
||||
.Const(_SC("GARBAGEMAN_C"), SQMOD_SKIN_GARBAGEMAN_C)
|
||||
.Const(_SC("GARBAGEMAN_D"), SQMOD_SKIN_GARBAGEMAN_D)
|
||||
.Const(_SC("GARBAGEMAN_E"), SQMOD_SKIN_GARBAGEMAN_E)
|
||||
.Const(_SC("TRANNY"), SQMOD_SKIN_TRANNY)
|
||||
.Const(_SC("THUG_B"), SQMOD_SKIN_THUG_B)
|
||||
.Const(_SC("SPANDEX_GUY_A"), SQMOD_SKIN_SPANDEX_GUY_A)
|
||||
.Const(_SC("SPANDEX_GUY_B"), SQMOD_SKIN_SPANDEX_GUY_B)
|
||||
.Const(_SC("STRIPPER_A"), SQMOD_SKIN_STRIPPER_A)
|
||||
.Const(_SC("STRIPPER_B"), SQMOD_SKIN_STRIPPER_B)
|
||||
.Const(_SC("STRIPPER_C"), SQMOD_SKIN_STRIPPER_C)
|
||||
.Const(_SC("STORE_CLERK"), SQMOD_SKIN_STORE_CLERK)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EKEYCODE"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("ABNT_C1"), SQMOD_KEYCODE_ABNT_C1)
|
||||
.Const(_SC("ABNT_C2"), SQMOD_KEYCODE_ABNT_C2)
|
||||
.Const(_SC("ADD"), SQMOD_KEYCODE_ADD)
|
||||
.Const(_SC("ATTN"), SQMOD_KEYCODE_ATTN)
|
||||
.Const(_SC("BACK"), SQMOD_KEYCODE_BACK)
|
||||
.Const(_SC("CANCEL"), SQMOD_KEYCODE_CANCEL)
|
||||
.Const(_SC("CLEAR"), SQMOD_KEYCODE_CLEAR)
|
||||
.Const(_SC("CRSEL"), SQMOD_KEYCODE_CRSEL)
|
||||
.Const(_SC("DECIMAL"), SQMOD_KEYCODE_DECIMAL)
|
||||
.Const(_SC("DIVIDE"), SQMOD_KEYCODE_DIVIDE)
|
||||
.Const(_SC("EREOF"), SQMOD_KEYCODE_EREOF)
|
||||
.Const(_SC("ESCAPE"), SQMOD_KEYCODE_ESCAPE)
|
||||
.Const(_SC("EXECUTE"), SQMOD_KEYCODE_EXECUTE)
|
||||
.Const(_SC("EXSEL"), SQMOD_KEYCODE_EXSEL)
|
||||
.Const(_SC("ICO_CLEAR"), SQMOD_KEYCODE_ICO_CLEAR)
|
||||
.Const(_SC("ICO_HELP"), SQMOD_KEYCODE_ICO_HELP)
|
||||
.Const(_SC("KEY_0"), SQMOD_KEYCODE_KEY_0)
|
||||
.Const(_SC("KEY_1"), SQMOD_KEYCODE_KEY_1)
|
||||
.Const(_SC("KEY_2"), SQMOD_KEYCODE_KEY_2)
|
||||
.Const(_SC("KEY_3"), SQMOD_KEYCODE_KEY_3)
|
||||
.Const(_SC("KEY_4"), SQMOD_KEYCODE_KEY_4)
|
||||
.Const(_SC("KEY_5"), SQMOD_KEYCODE_KEY_5)
|
||||
.Const(_SC("KEY_6"), SQMOD_KEYCODE_KEY_6)
|
||||
.Const(_SC("KEY_7"), SQMOD_KEYCODE_KEY_7)
|
||||
.Const(_SC("KEY_8"), SQMOD_KEYCODE_KEY_8)
|
||||
.Const(_SC("KEY_9"), SQMOD_KEYCODE_KEY_9)
|
||||
.Const(_SC("KEY_A"), SQMOD_KEYCODE_KEY_A)
|
||||
.Const(_SC("KEY_B"), SQMOD_KEYCODE_KEY_B)
|
||||
.Const(_SC("KEY_C"), SQMOD_KEYCODE_KEY_C)
|
||||
.Const(_SC("KEY_D"), SQMOD_KEYCODE_KEY_D)
|
||||
.Const(_SC("KEY_E"), SQMOD_KEYCODE_KEY_E)
|
||||
.Const(_SC("KEY_F"), SQMOD_KEYCODE_KEY_F)
|
||||
.Const(_SC("KEY_G"), SQMOD_KEYCODE_KEY_G)
|
||||
.Const(_SC("KEY_H"), SQMOD_KEYCODE_KEY_H)
|
||||
.Const(_SC("KEY_I"), SQMOD_KEYCODE_KEY_I)
|
||||
.Const(_SC("KEY_J"), SQMOD_KEYCODE_KEY_J)
|
||||
.Const(_SC("KEY_K"), SQMOD_KEYCODE_KEY_K)
|
||||
.Const(_SC("KEY_L"), SQMOD_KEYCODE_KEY_L)
|
||||
.Const(_SC("KEY_M"), SQMOD_KEYCODE_KEY_M)
|
||||
.Const(_SC("KEY_N"), SQMOD_KEYCODE_KEY_N)
|
||||
.Const(_SC("KEY_O"), SQMOD_KEYCODE_KEY_O)
|
||||
.Const(_SC("KEY_P"), SQMOD_KEYCODE_KEY_P)
|
||||
.Const(_SC("KEY_Q"), SQMOD_KEYCODE_KEY_Q)
|
||||
.Const(_SC("KEY_R"), SQMOD_KEYCODE_KEY_R)
|
||||
.Const(_SC("KEY_S"), SQMOD_KEYCODE_KEY_S)
|
||||
.Const(_SC("KEY_T"), SQMOD_KEYCODE_KEY_T)
|
||||
.Const(_SC("KEY_U"), SQMOD_KEYCODE_KEY_U)
|
||||
.Const(_SC("KEY_V"), SQMOD_KEYCODE_KEY_V)
|
||||
.Const(_SC("KEY_W"), SQMOD_KEYCODE_KEY_W)
|
||||
.Const(_SC("KEY_X"), SQMOD_KEYCODE_KEY_X)
|
||||
.Const(_SC("KEY_Y"), SQMOD_KEYCODE_KEY_Y)
|
||||
.Const(_SC("KEY_Z"), SQMOD_KEYCODE_KEY_Z)
|
||||
.Const(_SC("MULTIPLY"), SQMOD_KEYCODE_MULTIPLY)
|
||||
.Const(_SC("NONAME"), SQMOD_KEYCODE_NONAME)
|
||||
.Const(_SC("NUMPAD0"), SQMOD_KEYCODE_NUMPAD0)
|
||||
.Const(_SC("NUMPAD1"), SQMOD_KEYCODE_NUMPAD1)
|
||||
.Const(_SC("NUMPAD2"), SQMOD_KEYCODE_NUMPAD2)
|
||||
.Const(_SC("NUMPAD3"), SQMOD_KEYCODE_NUMPAD3)
|
||||
.Const(_SC("NUMPAD4"), SQMOD_KEYCODE_NUMPAD4)
|
||||
.Const(_SC("NUMPAD5"), SQMOD_KEYCODE_NUMPAD5)
|
||||
.Const(_SC("NUMPAD6"), SQMOD_KEYCODE_NUMPAD6)
|
||||
.Const(_SC("NUMPAD7"), SQMOD_KEYCODE_NUMPAD7)
|
||||
.Const(_SC("NUMPAD8"), SQMOD_KEYCODE_NUMPAD8)
|
||||
.Const(_SC("NUMPAD9"), SQMOD_KEYCODE_NUMPAD9)
|
||||
.Const(_SC("OEM_1"), SQMOD_KEYCODE_OEM_1)
|
||||
.Const(_SC("OEM_102"), SQMOD_KEYCODE_OEM_102)
|
||||
.Const(_SC("OEM_2"), SQMOD_KEYCODE_OEM_2)
|
||||
.Const(_SC("OEM_3"), SQMOD_KEYCODE_OEM_3)
|
||||
.Const(_SC("OEM_4"), SQMOD_KEYCODE_OEM_4)
|
||||
.Const(_SC("OEM_5"), SQMOD_KEYCODE_OEM_5)
|
||||
.Const(_SC("OEM_6"), SQMOD_KEYCODE_OEM_6)
|
||||
.Const(_SC("OEM_7"), SQMOD_KEYCODE_OEM_7)
|
||||
.Const(_SC("OEM_8"), SQMOD_KEYCODE_OEM_8)
|
||||
.Const(_SC("OEM_ATTN"), SQMOD_KEYCODE_OEM_ATTN)
|
||||
.Const(_SC("OEM_AUTO"), SQMOD_KEYCODE_OEM_AUTO)
|
||||
.Const(_SC("OEM_AX"), SQMOD_KEYCODE_OEM_AX)
|
||||
.Const(_SC("OEM_BACKTAB"), SQMOD_KEYCODE_OEM_BACKTAB)
|
||||
.Const(_SC("OEM_CLEAR"), SQMOD_KEYCODE_OEM_CLEAR)
|
||||
.Const(_SC("OEM_COMMA"), SQMOD_KEYCODE_OEM_COMMA)
|
||||
.Const(_SC("OEM_COPY"), SQMOD_KEYCODE_OEM_COPY)
|
||||
.Const(_SC("OEM_CUSEL"), SQMOD_KEYCODE_OEM_CUSEL)
|
||||
.Const(_SC("OEM_ENLW"), SQMOD_KEYCODE_OEM_ENLW)
|
||||
.Const(_SC("OEM_FINISH"), SQMOD_KEYCODE_OEM_FINISH)
|
||||
.Const(_SC("OEM_FJ_LOYA"), SQMOD_KEYCODE_OEM_FJ_LOYA)
|
||||
.Const(_SC("OEM_FJ_MASSHOU"), SQMOD_KEYCODE_OEM_FJ_MASSHOU)
|
||||
.Const(_SC("OEM_FJ_ROYA"), SQMOD_KEYCODE_OEM_FJ_ROYA)
|
||||
.Const(_SC("OEM_FJ_TOUROKU"), SQMOD_KEYCODE_OEM_FJ_TOUROKU)
|
||||
.Const(_SC("OEM_JUMP"), SQMOD_KEYCODE_OEM_JUMP)
|
||||
.Const(_SC("OEM_MINUS"), SQMOD_KEYCODE_OEM_MINUS)
|
||||
.Const(_SC("OEM_PA1"), SQMOD_KEYCODE_OEM_PA1)
|
||||
.Const(_SC("OEM_PA2"), SQMOD_KEYCODE_OEM_PA2)
|
||||
.Const(_SC("OEM_PA3"), SQMOD_KEYCODE_OEM_PA3)
|
||||
.Const(_SC("OEM_PERIOD"), SQMOD_KEYCODE_OEM_PERIOD)
|
||||
.Const(_SC("OEM_PLUS"), SQMOD_KEYCODE_OEM_PLUS)
|
||||
.Const(_SC("OEM_RESET"), SQMOD_KEYCODE_OEM_RESET)
|
||||
.Const(_SC("OEM_WSCTRL"), SQMOD_KEYCODE_OEM_WSCTRL)
|
||||
.Const(_SC("PA1"), SQMOD_KEYCODE_PA1)
|
||||
.Const(_SC("PACKET"), SQMOD_KEYCODE_PACKET)
|
||||
.Const(_SC("PLAY"), SQMOD_KEYCODE_PLAY)
|
||||
.Const(_SC("PROCESSKEY"), SQMOD_KEYCODE_PROCESSKEY)
|
||||
.Const(_SC("RETURN"), SQMOD_KEYCODE_RETURN)
|
||||
.Const(_SC("SELECT"), SQMOD_KEYCODE_SELECT)
|
||||
.Const(_SC("SEPARATOR"), SQMOD_KEYCODE_SEPARATOR)
|
||||
.Const(_SC("SPACE"), SQMOD_KEYCODE_SPACE)
|
||||
.Const(_SC("SUBTRACT"), SQMOD_KEYCODE_SUBTRACT)
|
||||
.Const(_SC("TAB"), SQMOD_KEYCODE_TAB)
|
||||
.Const(_SC("ZOOM"), SQMOD_KEYCODE_ZOOM)
|
||||
.Const(_SC("ACCEPT"), SQMOD_KEYCODE_ACCEPT)
|
||||
.Const(_SC("APPS"), SQMOD_KEYCODE_APPS)
|
||||
.Const(_SC("BROWSER_BACK"), SQMOD_KEYCODE_BROWSER_BACK)
|
||||
.Const(_SC("BROWSER_FAVORITES"), SQMOD_KEYCODE_BROWSER_FAVORITES)
|
||||
.Const(_SC("BROWSER_FORWARD"), SQMOD_KEYCODE_BROWSER_FORWARD)
|
||||
.Const(_SC("BROWSER_HOME"), SQMOD_KEYCODE_BROWSER_HOME)
|
||||
.Const(_SC("BROWSER_REFRESH"), SQMOD_KEYCODE_BROWSER_REFRESH)
|
||||
.Const(_SC("BROWSER_SEARCH"), SQMOD_KEYCODE_BROWSER_SEARCH)
|
||||
.Const(_SC("BROWSER_STOP"), SQMOD_KEYCODE_BROWSER_STOP)
|
||||
.Const(_SC("CAPITAL"), SQMOD_KEYCODE_CAPITAL)
|
||||
.Const(_SC("CONVERT"), SQMOD_KEYCODE_CONVERT)
|
||||
.Const(_SC("DELETE"), SQMOD_KEYCODE_DELETE)
|
||||
.Const(_SC("DOWN"), SQMOD_KEYCODE_DOWN)
|
||||
.Const(_SC("END"), SQMOD_KEYCODE_END)
|
||||
.Const(_SC("F1"), SQMOD_KEYCODE_F1)
|
||||
.Const(_SC("F10"), SQMOD_KEYCODE_F10)
|
||||
.Const(_SC("F11"), SQMOD_KEYCODE_F11)
|
||||
.Const(_SC("F12"), SQMOD_KEYCODE_F12)
|
||||
.Const(_SC("F13"), SQMOD_KEYCODE_F13)
|
||||
.Const(_SC("F14"), SQMOD_KEYCODE_F14)
|
||||
.Const(_SC("F15"), SQMOD_KEYCODE_F15)
|
||||
.Const(_SC("F16"), SQMOD_KEYCODE_F16)
|
||||
.Const(_SC("F17"), SQMOD_KEYCODE_F17)
|
||||
.Const(_SC("F18"), SQMOD_KEYCODE_F18)
|
||||
.Const(_SC("F19"), SQMOD_KEYCODE_F19)
|
||||
.Const(_SC("F2"), SQMOD_KEYCODE_F2)
|
||||
.Const(_SC("F20"), SQMOD_KEYCODE_F20)
|
||||
.Const(_SC("F21"), SQMOD_KEYCODE_F21)
|
||||
.Const(_SC("F22"), SQMOD_KEYCODE_F22)
|
||||
.Const(_SC("F23"), SQMOD_KEYCODE_F23)
|
||||
.Const(_SC("F24"), SQMOD_KEYCODE_F24)
|
||||
.Const(_SC("F3"), SQMOD_KEYCODE_F3)
|
||||
.Const(_SC("F4"), SQMOD_KEYCODE_F4)
|
||||
.Const(_SC("F5"), SQMOD_KEYCODE_F5)
|
||||
.Const(_SC("F6"), SQMOD_KEYCODE_F6)
|
||||
.Const(_SC("F7"), SQMOD_KEYCODE_F7)
|
||||
.Const(_SC("F8"), SQMOD_KEYCODE_F8)
|
||||
.Const(_SC("F9"), SQMOD_KEYCODE_F9)
|
||||
.Const(_SC("FINAL"), SQMOD_KEYCODE_FINAL)
|
||||
.Const(_SC("HELP"), SQMOD_KEYCODE_HELP)
|
||||
.Const(_SC("HOME"), SQMOD_KEYCODE_HOME)
|
||||
.Const(_SC("ICO_00"), SQMOD_KEYCODE_ICO_00)
|
||||
.Const(_SC("INSERT"), SQMOD_KEYCODE_INSERT)
|
||||
.Const(_SC("JUNJA"), SQMOD_KEYCODE_JUNJA)
|
||||
.Const(_SC("KANA"), SQMOD_KEYCODE_KANA)
|
||||
.Const(_SC("KANJI"), SQMOD_KEYCODE_KANJI)
|
||||
.Const(_SC("LAUNCH_APP1"), SQMOD_KEYCODE_LAUNCH_APP1)
|
||||
.Const(_SC("LAUNCH_APP2"), SQMOD_KEYCODE_LAUNCH_APP2)
|
||||
.Const(_SC("LAUNCH_MAIL"), SQMOD_KEYCODE_LAUNCH_MAIL)
|
||||
.Const(_SC("LAUNCH_MEDIA_SELECT"), SQMOD_KEYCODE_LAUNCH_MEDIA_SELECT)
|
||||
.Const(_SC("LBUTTON"), SQMOD_KEYCODE_LBUTTON)
|
||||
.Const(_SC("LCONTROL"), SQMOD_KEYCODE_LCONTROL)
|
||||
.Const(_SC("LEFT"), SQMOD_KEYCODE_LEFT)
|
||||
.Const(_SC("LMENU"), SQMOD_KEYCODE_LMENU)
|
||||
.Const(_SC("LSHIFT"), SQMOD_KEYCODE_LSHIFT)
|
||||
.Const(_SC("LWIN"), SQMOD_KEYCODE_LWIN)
|
||||
.Const(_SC("MBUTTON"), SQMOD_KEYCODE_MBUTTON)
|
||||
.Const(_SC("MEDIA_NEXT_TRACK"), SQMOD_KEYCODE_MEDIA_NEXT_TRACK)
|
||||
.Const(_SC("MEDIA_PLAY_PAUSE"), SQMOD_KEYCODE_MEDIA_PLAY_PAUSE)
|
||||
.Const(_SC("MEDIA_PREV_TRACK"), SQMOD_KEYCODE_MEDIA_PREV_TRACK)
|
||||
.Const(_SC("MEDIA_STOP"), SQMOD_KEYCODE_MEDIA_STOP)
|
||||
.Const(_SC("MODECHANGE"), SQMOD_KEYCODE_MODECHANGE)
|
||||
.Const(_SC("NEXT"), SQMOD_KEYCODE_NEXT)
|
||||
.Const(_SC("NONCONVERT"), SQMOD_KEYCODE_NONCONVERT)
|
||||
.Const(_SC("NUMLOCK"), SQMOD_KEYCODE_NUMLOCK)
|
||||
.Const(_SC("OEM_FJ_JISHO"), SQMOD_KEYCODE_OEM_FJ_JISHO)
|
||||
.Const(_SC("PAUSE"), SQMOD_KEYCODE_PAUSE)
|
||||
.Const(_SC("PRINT"), SQMOD_KEYCODE_PRINT)
|
||||
.Const(_SC("PRIOR"), SQMOD_KEYCODE_PRIOR)
|
||||
.Const(_SC("RBUTTON"), SQMOD_KEYCODE_RBUTTON)
|
||||
.Const(_SC("RCONTROL"), SQMOD_KEYCODE_RCONTROL)
|
||||
.Const(_SC("RIGHT"), SQMOD_KEYCODE_RIGHT)
|
||||
.Const(_SC("RMENU"), SQMOD_KEYCODE_RMENU)
|
||||
.Const(_SC("RSHIFT"), SQMOD_KEYCODE_RSHIFT)
|
||||
.Const(_SC("RWIN"), SQMOD_KEYCODE_RWIN)
|
||||
.Const(_SC("SCROLL"), SQMOD_KEYCODE_SCROLL)
|
||||
.Const(_SC("SLEEP"), SQMOD_KEYCODE_SLEEP)
|
||||
.Const(_SC("SNAPSHOT"), SQMOD_KEYCODE_SNAPSHOT)
|
||||
.Const(_SC("UP"), SQMOD_KEYCODE_UP)
|
||||
.Const(_SC("VOLUME_DOWN"), SQMOD_KEYCODE_VOLUME_DOWN)
|
||||
.Const(_SC("VOLUME_MUTE"), SQMOD_KEYCODE_VOLUME_MUTE)
|
||||
.Const(_SC("VOLUME_UP"), SQMOD_KEYCODE_VOLUME_UP)
|
||||
.Const(_SC("XBUTTON1"), SQMOD_KEYCODE_XBUTTON1)
|
||||
.Const(_SC("XBUTTON2"), SQMOD_KEYCODE_XBUTTON2)
|
||||
.Const(_SC("NONE"), SQMOD_KEYCODE_NONE)
|
||||
);
|
||||
|
||||
Sqrat::ConstTable(vm).Enum(_SC("EASCII"), Sqrat::Enumeration(vm)
|
||||
.Const(_SC("NUL"), SQMOD_ASCII_NUL)
|
||||
.Const(_SC("SOH"), SQMOD_ASCII_SOH)
|
||||
.Const(_SC("STX"), SQMOD_ASCII_STX)
|
||||
.Const(_SC("ETX"), SQMOD_ASCII_ETX)
|
||||
.Const(_SC("EOT"), SQMOD_ASCII_EOT)
|
||||
.Const(_SC("ENQ"), SQMOD_ASCII_ENQ)
|
||||
.Const(_SC("ACK"), SQMOD_ASCII_ACK)
|
||||
.Const(_SC("BEL"), SQMOD_ASCII_BEL)
|
||||
.Const(_SC("BS"), SQMOD_ASCII_BS)
|
||||
.Const(_SC("TAB"), SQMOD_ASCII_TAB)
|
||||
.Const(_SC("LF"), SQMOD_ASCII_LF)
|
||||
.Const(_SC("VT"), SQMOD_ASCII_VT)
|
||||
.Const(_SC("FF"), SQMOD_ASCII_FF)
|
||||
.Const(_SC("CR"), SQMOD_ASCII_CR)
|
||||
.Const(_SC("SO"), SQMOD_ASCII_SO)
|
||||
.Const(_SC("SI"), SQMOD_ASCII_SI)
|
||||
.Const(_SC("DLE"), SQMOD_ASCII_DLE)
|
||||
.Const(_SC("DC1"), SQMOD_ASCII_DC1)
|
||||
.Const(_SC("DC2"), SQMOD_ASCII_DC2)
|
||||
.Const(_SC("DC3"), SQMOD_ASCII_DC3)
|
||||
.Const(_SC("DC4"), SQMOD_ASCII_DC4)
|
||||
.Const(_SC("NAK"), SQMOD_ASCII_NAK)
|
||||
.Const(_SC("SYN"), SQMOD_ASCII_SYN)
|
||||
.Const(_SC("ETB"), SQMOD_ASCII_ETB)
|
||||
.Const(_SC("CAN"), SQMOD_ASCII_CAN)
|
||||
.Const(_SC("EM"), SQMOD_ASCII_EM)
|
||||
.Const(_SC("SUB"), SQMOD_ASCII_SUB)
|
||||
.Const(_SC("ESC"), SQMOD_ASCII_ESC)
|
||||
.Const(_SC("FS"), SQMOD_ASCII_FS)
|
||||
.Const(_SC("GS"), SQMOD_ASCII_GS)
|
||||
.Const(_SC("RS"), SQMOD_ASCII_RS)
|
||||
.Const(_SC("US"), SQMOD_ASCII_US)
|
||||
.Const(_SC("SPACE"), SQMOD_ASCII_SPACE)
|
||||
.Const(_SC("EXCLAMATION_POINT"), SQMOD_ASCII_EXCLAMATION_POINT)
|
||||
.Const(_SC("DOUBLE_QUOTES"), SQMOD_ASCII_DOUBLE_QUOTES)
|
||||
.Const(_SC("NUMBER_SIGN"), SQMOD_ASCII_NUMBER_SIGN)
|
||||
.Const(_SC("DOLLAR_SIGN"), SQMOD_ASCII_DOLLAR_SIGN)
|
||||
.Const(_SC("PERCENT_SIGN"), SQMOD_ASCII_PERCENT_SIGN)
|
||||
.Const(_SC("AMPERSAND"), SQMOD_ASCII_AMPERSAND)
|
||||
.Const(_SC("SINGLE_QUOTE"), SQMOD_ASCII_SINGLE_QUOTE)
|
||||
.Const(_SC("OPENING_PARENTHESIS"), SQMOD_ASCII_OPENING_PARENTHESIS)
|
||||
.Const(_SC("CLOSING_PARENTHESIS"), SQMOD_ASCII_CLOSING_PARENTHESIS)
|
||||
.Const(_SC("ASTERISK"), SQMOD_ASCII_ASTERISK)
|
||||
.Const(_SC("PLUS"), SQMOD_ASCII_PLUS)
|
||||
.Const(_SC("COMMA"), SQMOD_ASCII_COMMA)
|
||||
.Const(_SC("MINUS"), SQMOD_ASCII_MINUS)
|
||||
.Const(_SC("PERIOD"), SQMOD_ASCII_PERIOD)
|
||||
.Const(_SC("SLASH"), SQMOD_ASCII_SLASH)
|
||||
.Const(_SC("ZERO"), SQMOD_ASCII_ZERO)
|
||||
.Const(_SC("ONE"), SQMOD_ASCII_ONE)
|
||||
.Const(_SC("TWO"), SQMOD_ASCII_TWO)
|
||||
.Const(_SC("THREE"), SQMOD_ASCII_THREE)
|
||||
.Const(_SC("FOUR"), SQMOD_ASCII_FOUR)
|
||||
.Const(_SC("FIVE"), SQMOD_ASCII_FIVE)
|
||||
.Const(_SC("SIX"), SQMOD_ASCII_SIX)
|
||||
.Const(_SC("SEVEN"), SQMOD_ASCII_SEVEN)
|
||||
.Const(_SC("EIGHT"), SQMOD_ASCII_EIGHT)
|
||||
.Const(_SC("NINE"), SQMOD_ASCII_NINE)
|
||||
.Const(_SC("COLON"), SQMOD_ASCII_COLON)
|
||||
.Const(_SC("EMICOLON"), SQMOD_ASCII_EMICOLON)
|
||||
.Const(_SC("LESS_THAN_SIGN"), SQMOD_ASCII_LESS_THAN_SIGN)
|
||||
.Const(_SC("EQUAL_SIGN"), SQMOD_ASCII_EQUAL_SIGN)
|
||||
.Const(_SC("GREATER_THAN_SIGN"), SQMOD_ASCII_GREATER_THAN_SIGN)
|
||||
.Const(_SC("QUESTION_MARK"), SQMOD_ASCII_QUESTION_MARK)
|
||||
.Const(_SC("AT"), SQMOD_ASCII_AT)
|
||||
.Const(_SC("UPPER_A"), SQMOD_ASCII_UPPER_A)
|
||||
.Const(_SC("UPPER_B"), SQMOD_ASCII_UPPER_B)
|
||||
.Const(_SC("UPPER_C"), SQMOD_ASCII_UPPER_C)
|
||||
.Const(_SC("UPPER_D"), SQMOD_ASCII_UPPER_D)
|
||||
.Const(_SC("UPPER_E"), SQMOD_ASCII_UPPER_E)
|
||||
.Const(_SC("UPPER_F"), SQMOD_ASCII_UPPER_F)
|
||||
.Const(_SC("UPPER_G"), SQMOD_ASCII_UPPER_G)
|
||||
.Const(_SC("UPPER_H"), SQMOD_ASCII_UPPER_H)
|
||||
.Const(_SC("UPPER_I"), SQMOD_ASCII_UPPER_I)
|
||||
.Const(_SC("UPPER_J"), SQMOD_ASCII_UPPER_J)
|
||||
.Const(_SC("UPPER_K"), SQMOD_ASCII_UPPER_K)
|
||||
.Const(_SC("UPPER_L"), SQMOD_ASCII_UPPER_L)
|
||||
.Const(_SC("UPPER_M"), SQMOD_ASCII_UPPER_M)
|
||||
.Const(_SC("UPPER_N"), SQMOD_ASCII_UPPER_N)
|
||||
.Const(_SC("UPPER_O"), SQMOD_ASCII_UPPER_O)
|
||||
.Const(_SC("UPPER_P"), SQMOD_ASCII_UPPER_P)
|
||||
.Const(_SC("UPPER_Q"), SQMOD_ASCII_UPPER_Q)
|
||||
.Const(_SC("UPPER_R"), SQMOD_ASCII_UPPER_R)
|
||||
.Const(_SC("UPPER_S"), SQMOD_ASCII_UPPER_S)
|
||||
.Const(_SC("UPPER_T"), SQMOD_ASCII_UPPER_T)
|
||||
.Const(_SC("UPPER_U"), SQMOD_ASCII_UPPER_U)
|
||||
.Const(_SC("UPPER_V"), SQMOD_ASCII_UPPER_V)
|
||||
.Const(_SC("UPPER_W"), SQMOD_ASCII_UPPER_W)
|
||||
.Const(_SC("UPPER_X"), SQMOD_ASCII_UPPER_X)
|
||||
.Const(_SC("UPPER_Y"), SQMOD_ASCII_UPPER_Y)
|
||||
.Const(_SC("UPPER_Z"), SQMOD_ASCII_UPPER_Z)
|
||||
.Const(_SC("OPENING_BRACKET"), SQMOD_ASCII_OPENING_BRACKET)
|
||||
.Const(_SC("BACKSLASH"), SQMOD_ASCII_BACKSLASH)
|
||||
.Const(_SC("CLOSING_BRACKET"), SQMOD_ASCII_CLOSING_BRACKET)
|
||||
.Const(_SC("CARET"), SQMOD_ASCII_CARET)
|
||||
.Const(_SC("UNDERSCORE"), SQMOD_ASCII_UNDERSCORE)
|
||||
.Const(_SC("GRAVE_ACCENT"), SQMOD_ASCII_GRAVE_ACCENT)
|
||||
.Const(_SC("LOWER_A"), SQMOD_ASCII_LOWER_A)
|
||||
.Const(_SC("LOWER_B"), SQMOD_ASCII_LOWER_B)
|
||||
.Const(_SC("LOWER_C"), SQMOD_ASCII_LOWER_C)
|
||||
.Const(_SC("LOWER_D"), SQMOD_ASCII_LOWER_D)
|
||||
.Const(_SC("LOWER_E"), SQMOD_ASCII_LOWER_E)
|
||||
.Const(_SC("LOWER_F"), SQMOD_ASCII_LOWER_F)
|
||||
.Const(_SC("LOWER_G"), SQMOD_ASCII_LOWER_G)
|
||||
.Const(_SC("LOWER_H"), SQMOD_ASCII_LOWER_H)
|
||||
.Const(_SC("LOWER_I"), SQMOD_ASCII_LOWER_I)
|
||||
.Const(_SC("LOWER_J"), SQMOD_ASCII_LOWER_J)
|
||||
.Const(_SC("LOWER_K"), SQMOD_ASCII_LOWER_K)
|
||||
.Const(_SC("LOWER_L"), SQMOD_ASCII_LOWER_L)
|
||||
.Const(_SC("LOWER_M"), SQMOD_ASCII_LOWER_M)
|
||||
.Const(_SC("LOWER_N"), SQMOD_ASCII_LOWER_N)
|
||||
.Const(_SC("LOWER_O"), SQMOD_ASCII_LOWER_O)
|
||||
.Const(_SC("LOWER_P"), SQMOD_ASCII_LOWER_P)
|
||||
.Const(_SC("LOWER_Q"), SQMOD_ASCII_LOWER_Q)
|
||||
.Const(_SC("LOWER_R"), SQMOD_ASCII_LOWER_R)
|
||||
.Const(_SC("LOWER_S"), SQMOD_ASCII_LOWER_S)
|
||||
.Const(_SC("LOWER_T"), SQMOD_ASCII_LOWER_T)
|
||||
.Const(_SC("LOWER_U"), SQMOD_ASCII_LOWER_U)
|
||||
.Const(_SC("LOWER_V"), SQMOD_ASCII_LOWER_V)
|
||||
.Const(_SC("LOWER_W"), SQMOD_ASCII_LOWER_W)
|
||||
.Const(_SC("LOWER_X"), SQMOD_ASCII_LOWER_X)
|
||||
.Const(_SC("LOWER_Y"), SQMOD_ASCII_LOWER_Y)
|
||||
.Const(_SC("LOWER_Z"), SQMOD_ASCII_LOWER_Z)
|
||||
.Const(_SC("OPENING_BRACE"), SQMOD_ASCII_OPENING_BRACE)
|
||||
.Const(_SC("VERTICAL_BAR"), SQMOD_ASCII_VERTICAL_BAR)
|
||||
.Const(_SC("CLOSING_BRACE"), SQMOD_ASCII_CLOSING_BRACE)
|
||||
.Const(_SC("TILDE"), SQMOD_ASCII_TILDE)
|
||||
.Const(_SC("UNDEFINED"), SQMOD_ASCII_UNDEFINED)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,17 +1,177 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Functions.hpp"
|
||||
#include "Register.hpp"
|
||||
#include "Base/Vector3.hpp"
|
||||
#include "Library/Numeric.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Config.hpp"
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_Functions(HSQUIRRELVM vm)
|
||||
static ServerSettings g_SvSettings = {0};
|
||||
static SQChar g_SvNameBuff[SQMOD_SVNAMELENGTH] = {0};
|
||||
static SQChar g_PasswdBuff[SQMOD_PASSWDLENGTH] = {0};
|
||||
static SQChar g_GmNameBuff[SQMOD_GMNAMELENGTH] = {0};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static String CS_Keycode_Names[] = {"", /* index 0 is not used */
|
||||
"Left Button **", "Right Button **", "Break", "Middle Button **", "X Button 1 **",
|
||||
"X Button 2 **", "", "Backspace", "Tab", "",
|
||||
"", "Clear", "Enter", "", "",
|
||||
"", "", "", "Pause", "Caps Lock",
|
||||
"Kana", "", "Junja", "Final", "Kanji",
|
||||
"", "Esc", "Convert", "Non Convert", "Accept",
|
||||
"Mode Change", "Space", "Page Up", "Page Down", "End",
|
||||
"Home", "Arrow Left", "Arrow Up", "Arrow Right", "Arrow Down",
|
||||
"Select", "Print", "Execute", "Print Screen", "Insert",
|
||||
"Delete", "Help", "0", "1", "2",
|
||||
"3", "4", "5", "6", "7",
|
||||
"8", "9", "", "", "",
|
||||
"", "", "", "", "A",
|
||||
"B", "C", "D", "E", "F",
|
||||
"G", "H", "I", "J", "K",
|
||||
"L", "M", "N", "O", "P",
|
||||
"Q", "R", "S", "T", "U",
|
||||
"V", "W", "X", "Y", "Z",
|
||||
"Left Win", "Right Win", "Context Menu", "", "Sleep",
|
||||
"Numpad 0", "Numpad 1", "Numpad 2", "Numpad 3", "Numpad 4",
|
||||
"Numpad 5", "Numpad 6", "Numpad 7", "Numpad 8", "Numpad 9",
|
||||
"Numpad *", "Numpad +", "Separator", "Num -", "Numpad .",
|
||||
"Numpad /", "F1", "F2", "F3", "F4",
|
||||
"F5", "F6", "F7", "F8", "F9",
|
||||
"F10", "F11", "F12", "F13", "F14",
|
||||
"F15", "F16", "F17", "F18", "F19",
|
||||
"F20", "F21", "F22", "F23", "F24",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "Num Lock", "Scrol Lock",
|
||||
"Jisho", "Mashu", "Touroku", "Loya", "Roya",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "Left Shift",
|
||||
"Right Shift", "Left Ctrl", "Right Ctrl", "Left Alt", "Right Alt",
|
||||
"Browser Back", "Browser Forward", "Browser Refresh", "Browser Stop", "Browser Search",
|
||||
"Browser Favorites", "Browser Home", "Volume Mute", "Volume Down", "Volume Up",
|
||||
"Next Track", "Previous Track", "Stop", "Play / Pause", "Mail",
|
||||
"Media", "App1", "App2", "", "",
|
||||
"OEM_1 (: ;)", "OEM_PLUS (+ =)", "OEM_COMMA (< ,)", "OEM_MINUS (_ -)", "OEM_PERIOD (> .)",
|
||||
"OEM_2 (? /)", "OEM_3 (~ `)", "Abnt C1", "Abnt C2", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "", "", "OEM_4 ({ [)", "OEM_5 (| \\)",
|
||||
"OEM_6 (} ])", "OEM_7 (\" ')", "OEM_8 (? !)", "", "Ax",
|
||||
"OEM_102 (> <)", "IcoHlp", "Ico00 *", "Process", "IcoClr",
|
||||
"Packet", "", "Reset", "Jump", "OemPa1",
|
||||
"OemPa2", "OemPa3", "WsCtrl", "Cu Sel", "Oem Attn",
|
||||
"Finish", "Copy", "Auto", "Enlw", "Back Tab",
|
||||
"Attn", "Cr Sel", "Ex Sel", "Er Eof", "Play",
|
||||
"Zoom", "NoName", "Pa1", "OemClr", "no mapping"
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetKeyCodeName(Uint8 keycode)
|
||||
{ return CS_Keycode_Names[keycode].c_str(); }
|
||||
void SetKeyCodeName(Uint8 keycode, CCStr name)
|
||||
{ CS_Keycode_Names[keycode].assign(name); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetPluginVersion()
|
||||
{ return SQMOD_VERSION; }
|
||||
CCStr GetPluginVersionStr()
|
||||
{ return SQMOD_VERSION_STR; }
|
||||
CCStr GetPluginName()
|
||||
{ return SQMOD_NAME; }
|
||||
CCStr GetPluginAuthor()
|
||||
{ return SQMOD_AUTHOR; }
|
||||
Int32 GetPluginID()
|
||||
{ return _Info->nPluginId; }
|
||||
Uint32 GetNumberOfPlugins()
|
||||
{ return _Func->GetNumberOfPlugins(); }
|
||||
Int32 FindPlugin(CCStr name)
|
||||
{ return _Func->FindPlugin(const_cast< CStr >(name)); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetServerVersion()
|
||||
{ return _Func->GetServerVersion(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetServerPort()
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
_Func->GetServerSettings(&g_SvSettings);
|
||||
return g_SvSettings.uPort;
|
||||
}
|
||||
|
||||
Uint32 GetServerFlags()
|
||||
{
|
||||
_Func->GetServerSettings(&g_SvSettings);
|
||||
return g_SvSettings.uFlags;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerName(CCStr name)
|
||||
{ _Func->SetServerName(name); }
|
||||
CCStr GetServerName()
|
||||
{
|
||||
_Func->GetServerName(g_SvNameBuff, SQMOD_SVNAMELENGTH);
|
||||
return g_SvNameBuff;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
ULongInt GetTime()
|
||||
{
|
||||
Uint64 time = 0;
|
||||
_Func->GetTime(&time);
|
||||
return ULongInt(time);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendCustomCommand(Uint32 type, CCStr cmd)
|
||||
{
|
||||
_Func->SendCustomCommand(type, cmd);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMaxPlayers(Int32 max)
|
||||
{
|
||||
_Func->SetMaxPlayers(max);
|
||||
}
|
||||
|
||||
Int32 GetMaxPlayers(void)
|
||||
{
|
||||
return _Func->GetMaxPlayers();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerPassword(CCStr passwd)
|
||||
{ _Func->SetServerPassword(const_cast< CStr >(passwd)); }
|
||||
CCStr GetServerPassword()
|
||||
{
|
||||
_Func->GetServerPassword(g_PasswdBuff, SQMOD_PASSWDLENGTH);
|
||||
return g_PasswdBuff;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGameModeText(CCStr text)
|
||||
{ _Func->SetGameModeText(text); }
|
||||
CCStr GetGameModeText()
|
||||
{
|
||||
_Func->GetGameModeText(g_GmNameBuff, SQMOD_GMNAMELENGTH);
|
||||
return g_GmNameBuff;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 PlaySound(Int32 world, Int32 sound, const Vector3 & pos)
|
||||
{ return _Func->PlaySound(world, sound, pos.x, pos.y, pos.z); }
|
||||
Int32 PlaySoundEx(Int32 world, Int32 sound, Float32 x, Float32 y, Float32 z)
|
||||
{ return _Func->PlaySound(world, sound, x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 AddRadioStream(Int32 id, CCStr name, CCStr url, bool listed)
|
||||
{ return _Func->AddRadioStream(id, name, url, listed); }
|
||||
Int32 RemoveRadioStream(Int32 id)
|
||||
{ return _Func->RemoveRadioStream(id); }
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@@ -1,11 +1,62 @@
|
||||
#ifndef _MISC_FUNCTIONS_HPP_
|
||||
#define _MISC_FUNCTIONS_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetKeyCodeName(Uint8 keycode);
|
||||
void SetKeyCodeName(Uint8 keycode, CCStr name);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetPluginVersion();
|
||||
CCStr GetPluginVersionStr();
|
||||
CCStr GetPluginName();
|
||||
CCStr GetPluginAuthor();
|
||||
Int32 GetPluginID();
|
||||
Uint32 GetNumberOfPlugins();
|
||||
Int32 FindPlugin(CCStr name);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetServerVersion();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Uint32 GetServerPort();
|
||||
Uint32 GetServerFlags();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerName(CCStr name);
|
||||
CCStr GetServerName();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
ULongInt GetTime();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SendCustomCommand(Uint32 type, CCStr cmd);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMaxPlayers(Int32 max);
|
||||
Int32 GetMaxPlayers(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetServerPassword(CCStr passwd);
|
||||
CCStr GetServerPassword();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGameModeText(CCStr text);
|
||||
CCStr GetGameModeText();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 PlaySound(Int32 world, Int32 sound, const Vector3 & pos);
|
||||
Int32 PlaySoundEx(Int32 world, Int32 sound, Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 AddRadioStream(Int32 id, CCStr name, CCStr url, bool listed);
|
||||
Int32 RemoveRadioStream(Int32 id);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_FUNCTIONS_HPP_
|
||||
#endif // _MISC_FUNCTIONS_HPP_
|
||||
|
@@ -1,300 +1,76 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Model.hpp"
|
||||
#include "Base/Vector3.hpp"
|
||||
#include "Entity.hpp"
|
||||
#include "Register.hpp"
|
||||
#include "Core.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const CModel CModel::NIL;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel::CModel()
|
||||
: m_ID(SQMOD_UNKNOWN)
|
||||
CCStr GetModelName(Int32 id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CModel::CModel(SQInt32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, Max))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CModel::CModel(const SQChar * name, SQInt32 id)
|
||||
: m_ID(GetWeaponID(name))
|
||||
{
|
||||
if (VALID_ENTITYGETEX(m_ID, Max))
|
||||
{
|
||||
m_ID = id;
|
||||
}
|
||||
// @TODO Implement...
|
||||
SQMOD_UNUSED_VAR(id);
|
||||
return _SC("");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel::CModel(const CModel & m)
|
||||
: m_ID(m.m_ID)
|
||||
, m_Tag(m.m_Tag)
|
||||
, m_Data(m.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CModel::CModel(CModel && m)
|
||||
: m_ID(m.m_ID)
|
||||
, m_Tag(m.m_Tag)
|
||||
, m_Data(m.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel::~CModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel & CModel::operator = (const CModel & m)
|
||||
{
|
||||
m_ID = m.m_ID;
|
||||
m_Tag = m.m_Tag;
|
||||
m_Data = m.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CModel & CModel::operator = (CModel && m)
|
||||
{
|
||||
m_ID = m.m_ID;
|
||||
m_Tag = m.m_Tag;
|
||||
m_Data = m.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel & CModel::operator = (SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CModel::operator == (const CModel & m) const
|
||||
{
|
||||
return (m_ID == m.m_ID);
|
||||
}
|
||||
|
||||
bool CModel::operator != (const CModel & m) const
|
||||
{
|
||||
return (m_ID != m.m_ID);
|
||||
}
|
||||
|
||||
bool CModel::operator < (const CModel & m) const
|
||||
{
|
||||
return (m_ID < m.m_ID);
|
||||
}
|
||||
|
||||
bool CModel::operator > (const CModel & m) const
|
||||
{
|
||||
return (m_ID < m.m_ID);
|
||||
}
|
||||
|
||||
bool CModel::operator <= (const CModel & m) const
|
||||
{
|
||||
return (m_ID <= m.m_ID);
|
||||
}
|
||||
|
||||
bool CModel::operator >= (const CModel & m) const
|
||||
{
|
||||
return (m_ID >= m.m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CModel::Cmp(const CModel & m) const
|
||||
{
|
||||
if (m_ID == m.m_ID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (m_ID > m.m_ID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CModel::ToString() const
|
||||
{
|
||||
return GetModelName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CModel::GetID() const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
void CModel::SetID(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CModel & CModel::SetnGet(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CModel::GetGlobalTag() const
|
||||
{
|
||||
return GlobalTag(m_ID);
|
||||
}
|
||||
|
||||
void CModel::SetGlobalTag(const SQChar * tag) const
|
||||
{
|
||||
GlobalTag(m_ID, tag);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CModel::GetGlobalData() const
|
||||
{
|
||||
return GlobalData(m_ID);
|
||||
}
|
||||
|
||||
void CModel::SetGlobalData(SqObj & data) const
|
||||
{
|
||||
GlobalData(m_ID, data);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CModel::GetLocalTag() const
|
||||
{
|
||||
return m_Tag.c_str();
|
||||
}
|
||||
|
||||
void CModel::SetLocalTag(const SQChar * tag)
|
||||
{
|
||||
m_Tag = tag;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CModel::GetLocalData()
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
|
||||
void CModel::SetLocalData(SqObj & data)
|
||||
{
|
||||
m_Data = data;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CModel::IsValid() const
|
||||
{
|
||||
return (VALID_ENTITYEX(m_ID, Max));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CModel::GetName() const
|
||||
{
|
||||
return GetModelName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CModel::SetName(const SQChar * name)
|
||||
void SetModelName(Int32 id, CCStr name)
|
||||
{
|
||||
// @TODO Implement...
|
||||
SQMOD_UNUSED_VAR(id);
|
||||
SQMOD_UNUSED_VAR(name);
|
||||
m_ID = -1; /* @TODO Implement! */
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CModel::IsWeapon() const
|
||||
bool IsModelWeapon(Int32 id)
|
||||
{
|
||||
return IsModelWeapon(m_ID);
|
||||
}
|
||||
|
||||
bool CModel::IsActuallyWeapon() const
|
||||
{
|
||||
return IsModelActuallyWeapon(m_ID);
|
||||
switch (id)
|
||||
{
|
||||
case 258:
|
||||
case 259:
|
||||
case 260:
|
||||
case 261:
|
||||
case 262:
|
||||
case 263:
|
||||
case 264:
|
||||
case 265:
|
||||
case 266:
|
||||
case 267:
|
||||
case 268:
|
||||
case 269:
|
||||
case 270:
|
||||
case 271:
|
||||
case 272:
|
||||
case 273:
|
||||
case 274:
|
||||
case 275:
|
||||
case 276:
|
||||
case 277:
|
||||
case 278:
|
||||
case 279:
|
||||
case 280:
|
||||
case 281:
|
||||
case 282:
|
||||
case 283:
|
||||
case 284:
|
||||
case 285:
|
||||
case 286:
|
||||
case 287:
|
||||
case 288:
|
||||
case 289:
|
||||
case 290:
|
||||
case 291:
|
||||
case 292:
|
||||
case 293:
|
||||
case 294: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Reference< CObject > CModel::Object(SQInt32 world, const Vector3 & pos, SQInt32 alpha, SQInt32 header, \
|
||||
SqObj & payload) const
|
||||
{
|
||||
return _Core->NewObject(m_ID, world, pos.x, pos.y, pos.z, alpha, header, payload);
|
||||
}
|
||||
|
||||
Reference< CObject > CModel::Object(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQInt32 alpha, \
|
||||
SQInt32 header, SqObj & payload) const
|
||||
{
|
||||
return _Core->NewObject(m_ID, world, x, y, z, alpha, header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Reference< CPickup > CModel::Pickup(SQInt32 world, SQInt32 quantity, const Vector3 & pos, SQInt32 alpha, \
|
||||
bool automatic, SQInt32 header, SqObj & payload) const
|
||||
{
|
||||
return _Core->NewPickup(m_ID, world, quantity, pos.x, pos.y, pos.z, alpha, automatic, header, payload);
|
||||
}
|
||||
|
||||
Reference< CPickup > CModel::Pickup(SQInt32 world, SQInt32 quantity, SQFloat x, SQFloat y, SQFloat z, \
|
||||
SQInt32 alpha, bool automatic, SQInt32 header, SqObj & payload) const
|
||||
{
|
||||
return _Core->NewPickup(m_ID, world, quantity, x, y, z, alpha, automatic, header, payload);
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_CModel(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <CModel> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("CModel"), Sqrat::Class< CModel >(vm, _SC("CModel"))
|
||||
/* Constructors */
|
||||
.Ctor()
|
||||
.Ctor< SQInt32 >()
|
||||
.Ctor< const SQChar *, SQInt32 >()
|
||||
/* Metamethods */
|
||||
.Func(_SC("_cmp"), &CModel::Cmp)
|
||||
.Func(_SC("_tostring"), &CModel::ToString)
|
||||
/* Properties */
|
||||
.Prop(_SC("id"), &CModel::GetID, &CModel::SetID)
|
||||
.Prop(_SC("gtag"), &CModel::GetGlobalTag, &CModel::SetGlobalTag)
|
||||
.Prop(_SC("gdata"), &CModel::GetGlobalData, &CModel::SetGlobalData)
|
||||
.Prop(_SC("ltag"), &CModel::GetLocalTag, &CModel::SetLocalTag)
|
||||
.Prop(_SC("ldata"), &CModel::GetLocalData, &CModel::SetLocalData)
|
||||
.Prop(_SC("valid"), &CModel::IsValid)
|
||||
.Prop(_SC("name"), &CModel::GetName, &CModel::SetName)
|
||||
.Prop(_SC("weapon"), &CModel::IsWeapon)
|
||||
.Prop(_SC("truly_weapon"), &CModel::IsActuallyWeapon)
|
||||
/* Functions */
|
||||
.Func(_SC("setng"), &CModel::SetnGet)
|
||||
/* Overloads */
|
||||
.Overload< Reference< CObject > (CModel::*)(SQInt32, const Vector3 &, SQInt32, SQInt32, SqObj &) const >
|
||||
(_SC("object"), &CModel::Object)
|
||||
.Overload< Reference< CObject > (CModel::*)(SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, SQInt32, SqObj &) const >
|
||||
(_SC("object"), &CModel::Object)
|
||||
.Overload< Reference< CPickup > (CModel::*)(SQInt32, SQInt32, const Vector3 &, SQInt32, bool, SQInt32, SqObj &) const >
|
||||
(_SC("pickup"), &CModel::Pickup)
|
||||
.Overload< Reference< CPickup > (CModel::*)(SQInt32, SQInt32, SQFloat, SQFloat, SQFloat, SQInt32, bool, SQInt32, SqObj &) const >
|
||||
(_SC("pickup"), &CModel::Pickup)
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CModel> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@@ -2,263 +2,17 @@
|
||||
#define _MISC_MODEL_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Shared.hpp"
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Class responsible for managing and interacting with object and pickup models.
|
||||
*/
|
||||
class CModel : public IdentifierStorage< CModel, SQMOD_MODELID_CAP >
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Helper member for times when a null reference to an instance of this type is needed.
|
||||
*/
|
||||
static const CModel NIL;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Default constructor.
|
||||
*/
|
||||
CModel();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model specified.
|
||||
*/
|
||||
CModel(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model extracted from the specified name.
|
||||
*/
|
||||
CModel(const SQChar * name, SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy constructor.
|
||||
*/
|
||||
CModel(const CModel & m);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move constructor.
|
||||
*/
|
||||
CModel(CModel && m);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*/
|
||||
~CModel();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy assignment operator.
|
||||
*/
|
||||
CModel & operator = (const CModel & m);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move assignment operator.
|
||||
*/
|
||||
CModel & operator = (CModel && m);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Model identifier assignment operator.
|
||||
*/
|
||||
CModel & operator = (SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Equality comparison operator.
|
||||
*/
|
||||
bool operator == (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Inequality comparison operator.
|
||||
*/
|
||||
bool operator != (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than comparison operator.
|
||||
*/
|
||||
bool operator < (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than comparison operator.
|
||||
*/
|
||||
bool operator > (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than or equal comparison operator.
|
||||
*/
|
||||
bool operator <= (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than or equal comparison operator.
|
||||
*/
|
||||
bool operator >= (const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to model identifier.
|
||||
*/
|
||||
operator SQInt32 () const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to model identifier.
|
||||
*/
|
||||
operator Int64 () const
|
||||
{
|
||||
return _SCI64(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to boolean.
|
||||
*/
|
||||
operator bool () const
|
||||
{
|
||||
return IsModelValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Negation operator.
|
||||
*/
|
||||
bool operator ! () const
|
||||
{
|
||||
return !IsModelValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script to compare two instances of this type.
|
||||
*/
|
||||
SQInteger Cmp(const CModel & m) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Convert this type to a string.
|
||||
*/
|
||||
const SQChar * ToString() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier referenced by this instance.
|
||||
*/
|
||||
SQInteger GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier referenced by this instance.
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the identifier that this insance should reference and
|
||||
* get a reference to the instance to chain operations.
|
||||
*/
|
||||
CModel & SetnGet(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global tag.
|
||||
*/
|
||||
const SQChar * GetGlobalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global tag.
|
||||
*/
|
||||
void SetGlobalTag(const SQChar * tag) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global data.
|
||||
*/
|
||||
SqObj & GetGlobalData() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global data.
|
||||
*/
|
||||
void SetGlobalData(SqObj & data) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local tag.
|
||||
*/
|
||||
const SQChar * GetLocalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local tag.
|
||||
*/
|
||||
void SetLocalTag(const SQChar * tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local data.
|
||||
*/
|
||||
SqObj & GetLocalData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local data.
|
||||
*/
|
||||
void SetLocalData(SqObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the referenced model identifier is valid.
|
||||
*/
|
||||
bool IsValid() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the name of the referenced model.
|
||||
*/
|
||||
const SQChar * GetName() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier of the referenced model.
|
||||
*/
|
||||
void SetName(const SQChar * name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the referenced model identifier is a weapon model.
|
||||
*/
|
||||
bool IsWeapon() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the referenced model identifier is truly a weapon model
|
||||
* and not something like a camera.
|
||||
*/
|
||||
bool IsActuallyWeapon() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create an object instance using the referenced model.
|
||||
*/
|
||||
Reference< CObject > Object(SQInt32 world, const Vector3 & pos, SQInt32 alpha, SQInt32 header,
|
||||
SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create an object instance using the referenced model.
|
||||
*/
|
||||
Reference< CObject > Object(SQInt32 world, SQFloat x, SQFloat y, SQFloat z, SQInt32 alpha,
|
||||
SQInt32 header, SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a pickup instance using the referenced model.
|
||||
*/
|
||||
Reference< CPickup > Pickup(SQInt32 world, SQInt32 quantity, const Vector3 & pos, SQInt32 alpha,
|
||||
bool automatic, SQInt32 header, SqObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a pickup instance using the referenced model.
|
||||
*/
|
||||
Reference< CPickup > Pickup(SQInt32 world, SQInt32 quantity, SQFloat x, SQFloat y, SQFloat z,
|
||||
SQInt32 alpha, bool automatic, SQInt32 header, SqObj & payload) const;
|
||||
|
||||
private:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The identifier of the referenced model.
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local tag associated with this instance.
|
||||
*/
|
||||
SqTag m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local data associated with this instance.
|
||||
*/
|
||||
SqObj m_Data;
|
||||
};
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetModelName(Int32 id);
|
||||
void SetModelName(Int32 id, CCStr name);
|
||||
bool IsModelWeapon(Int32 id);
|
||||
bool IsModelActuallyWeapon(Int32 id);
|
||||
bool IsWeaponNatural(Int32 id);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
|
750
source/Misc/Player.cpp
Normal file
750
source/Misc/Player.cpp
Normal file
@@ -0,0 +1,750 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Player.hpp"
|
||||
#include "Base/Color3.hpp"
|
||||
#include "Core.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static String CS_Skin_Names[] = {
|
||||
"Tommy Vercetti", "Cop", "SWAT", "FBI", "Army",
|
||||
"Paramedic", "Firefighter", "Golf Guy #1", "", "Bum Lady #1",
|
||||
"Bum Lady #2", "Punk #1", "Lawyer", "Spanish Lady #1", "Spanish Lady #2",
|
||||
"Cool Guy #1", "Arabic Guy", "Beach Lady #1", "Beach Lady #2", "Beach Guy #1",
|
||||
"Beach Guy #2", "Office Lady #1", "Waitress #1", "Food Lady", "Prostitute #1",
|
||||
"Bum Lady #3", "Bum Guy #1", "Garbageman #1", "Taxi Driver #1", "Haitian #1",
|
||||
"Criminal #1", "Hood Lady", "Granny #1", "Businessman #1", "Church Guy",
|
||||
"Club Lady", "Church Lady", "Pimp", "Beach Lady #3", "Beach Guy #3",
|
||||
"Beach Lady #4", "Beach Guy #4", "Businessman #2", "Prostitute #2", "Bum Lady #4",
|
||||
"Bum Guy #2", "Haitian #2", "Construction Worker #1","Punk #2", "Prostitute #3",
|
||||
"Granny #2", "Punk #3", "Businessman #3", "Spanish Lady #3", "Spanish Lady #4",
|
||||
"Cool Guy #2", "Businessman #4", "Beach Lady #5", "Beach Guy #5", "Beach Lady #6",
|
||||
"Beach Guy #6", "Construction Worker #2","Golf Guy #2", "Golf Lady", "Golf Guy #3",
|
||||
"Beach Lady #7", "Beach Guy #7", "Office Lady #2", "Businessman #5", "Businessman #6",
|
||||
"Prostitute #2", "Bum Lady #4", "Bum Guy #3", "Spanish Guy", "Taxi Driver #2",
|
||||
"Gym Lady", "Gym Guy", "Skate Lady", "Skate Guy", "Shopper #1",
|
||||
"Shopper #2", "Tourist #1", "Tourist #2", "Cuban #1", "Cuban #2",
|
||||
"Haitian #3", "Haitian #4", "Shark #1", "Shark #2", "Diaz Guy #1",
|
||||
"Diaz Guy #2", "DBP Security #1", "DBP Security #2", "Biker #1", "Biker #2",
|
||||
"Vercetti Guy #1", "Vercetti Guy #2", "Undercover Cop #1", "Undercover Cop #2", "Undercover Cop #3",
|
||||
"Undercover Cop #4", "Undercover Cop #5", "Undercover Cop #6", "Rich Guy", "Cool Guy #3",
|
||||
"Prostitute #3", "Prostitute #4", "Love Fist #1", "Ken Rosenburg", "Candy Suxx",
|
||||
"Hilary", "Love Fist #2", "Phil", "Rockstar Guy", "Sonny",
|
||||
"Lance", "Mercedes", "Love Fist #3", "Alex Shrub", "Lance (Cop)",
|
||||
"Lance", "Cortez", "Love Fist #4", "Columbian Guy #1", "Hilary (Robber)",
|
||||
"Mercedes", "Cam", "Cam (Robber)", "Phil (One Arm)", "Phil (Robber)",
|
||||
"Cool Guy #4", "Pizza Man", "Taxi Driver #1", "Taxi Driver #2", "Sailor #1",
|
||||
"Sailor #2", "Sailor #3", "Chef", "Criminal #2", "French Guy",
|
||||
"Garbageman #2", "Haitian #5", "Waitress #2", "Sonny Guy #1", "Sonny Guy #2",
|
||||
"Sonny Guy #3", "Columbian Guy #2", "Haitian #6", "Beach Guy #8", "Garbageman #3",
|
||||
"Garbageman #4", "Garbageman #5", "Tranny", "Thug #5", "SpandEx Guy #1",
|
||||
"SpandEx Guy #2", "Stripper #1", "Stripper #2", "Stripper #3", "Store Clerk",
|
||||
""
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetUseClasses(bool toggle)
|
||||
{ _Func->SetUseClasses(toggle); }
|
||||
bool GetUseClasses(void)
|
||||
{ return _Func->GetUseClasses(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 AddPlayerClass(Int32 team, const Color3 & color, Int32 skin, const Vector3 & pos, Float32 angle,
|
||||
Int32 w1, Int32 a1, Int32 w2, Int32 a2, Int32 w3, Int32 a3)
|
||||
{
|
||||
return _Func->AddPlayerClass(team, color.GetRGB(), skin, pos.x, pos.y, pos.z, angle,
|
||||
w1, a1, w2, a2, w3, a3);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnPlayerPos(const Vector3 & pos)
|
||||
{ _Func->SetSpawnPlayerPos(pos.x, pos.y, pos.z); }
|
||||
void SetSpawnPlayerPosEx(Float32 x, Float32 y, Float32 z)
|
||||
{ _Func->SetSpawnPlayerPos(x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnCameraPos(const Vector3 & pos)
|
||||
{ _Func->SetSpawnCameraPos(pos.x, pos.y, pos.z); }
|
||||
void SetSpawnCameraPosEx(Float32 x, Float32 y, Float32 z)
|
||||
{ _Func->SetSpawnCameraPos(x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnCameraLookAt(const Vector3 & pos)
|
||||
{ _Func->SetSpawnCameraLookAt(pos.x, pos.y, pos.z); }
|
||||
void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z)
|
||||
{ _Func->SetSpawnCameraLookAt(x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetSkinName(Uint32 id)
|
||||
{
|
||||
return (id > 159) ? g_EmptyStr : CS_Skin_Names[id].c_str();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSkinName(Uint32 id, CCStr name)
|
||||
{
|
||||
if (id <= 159)
|
||||
CS_Skin_Names[id].assign(name);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetSkinID(CCStr name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name);
|
||||
// Strip non alphanumeric characters from the name
|
||||
str.erase(std::remove_if(str.begin(), str.end(), std::not1(std::ptr_fun(::isalnum))), str.end());
|
||||
// Convert the string to lowercase
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
// See if we still have a valid name after the cleanup
|
||||
if(str.empty())
|
||||
return SQMOD_UNKNOWN;
|
||||
// Grab the actual length of the string
|
||||
Uint32 len = static_cast< Uint32 >(str.length());
|
||||
// Get the most significant characters used to identify a skin
|
||||
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
||||
// Look for deeper specifiers
|
||||
if (str.length() >= 3)
|
||||
{
|
||||
b = str[1];
|
||||
c = str[2];
|
||||
}
|
||||
else if (str.length() >= 2)
|
||||
b = str[1];
|
||||
// Search for a pattern in the name
|
||||
switch (a)
|
||||
{
|
||||
// [A]lex Srub, [A]rabic guy, [A]rmy
|
||||
case 'a':
|
||||
switch (b)
|
||||
{
|
||||
// [Al]ex [S]rub
|
||||
case 'l':
|
||||
case 's': return SQMOD_SKIN_ALEX_SRUB;
|
||||
// [A]rabic [g]uy
|
||||
case 'g': return SQMOD_SKIN_ARABIC_GUY;
|
||||
// [Ara]bic guy, [Arm]y
|
||||
case 'r':
|
||||
if (c == 'a') return SQMOD_SKIN_ARABIC_GUY;
|
||||
else if (c == 'm') return SQMOD_SKIN_ARMY;
|
||||
}
|
||||
// [B]each guy (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)/(#8|H)
|
||||
// [B]each lady (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)
|
||||
// [B]iker (#1|A)/(#2|B)
|
||||
// [B]um guy (#1|A)/(#2|B)/(#3|C)
|
||||
// [B]um lady (#1|A)/(#2|B)/(#2|C)/(#3|D)/(#4|E)
|
||||
// [B]usiness man (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
||||
case 'b':
|
||||
// [Be]ach [g]uy (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)/(#8|H)
|
||||
if (b == 'e' && (c == 'g' || (len > 4 && str[5] == 'g')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_BEACH_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_BEACH_GUY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_BEACH_GUY_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_BEACH_GUY_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_BEACH_GUY_E;
|
||||
case '6':
|
||||
case 'f': return SQMOD_SKIN_BEACH_GUY_F;
|
||||
case '7':
|
||||
case 'g': return SQMOD_SKIN_BEACH_GUY_G;
|
||||
case '8':
|
||||
case 'h': return SQMOD_SKIN_BEACH_GUY_H;
|
||||
}
|
||||
}
|
||||
// [Be]ach [l]ady (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)
|
||||
else if (b == 'e' && (c == 'l' || (len > 4 && str[5] == 'l')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_BEACH_LADY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_BEACH_LADY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_BEACH_LADY_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_BEACH_LADY_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_BEACH_LADY_E;
|
||||
case '6':
|
||||
case 'f': return SQMOD_SKIN_BEACH_LADY_F;
|
||||
case '7':
|
||||
case 'g': return SQMOD_SKIN_BEACH_LADY_G;
|
||||
}
|
||||
}
|
||||
// [Bi]ker (#1|A)/(#2|B)
|
||||
else if (b == 'i' && (d == '1' || d == 'a')) return SQMOD_SKIN_BIKER_A;
|
||||
else if (b == 'i' && (d == '2' || d == 'b')) return SQMOD_SKIN_BIKER_B;
|
||||
// [Bum] [g]uy (#1|A)/(#2|B)/(#3|C)
|
||||
// [Bum] [l]ady (#1|A)/(#2|B)/(#2|C)/(#3|D)/(#4|E)
|
||||
else if (b == 'u' && (c && (c == 'm' || c == 'g' || c == 'l')))
|
||||
{
|
||||
// [Bum] [g]uy (#1|A)/(#2|B)/(#3|C)
|
||||
if (c == 'g' || (len > 2 && str[3] == 'g'))
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_BUM_GUY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_BUM_GUY_B;
|
||||
else if (d == '3' || d == 'c') return SQMOD_SKIN_BUM_GUY_C;
|
||||
}
|
||||
// [Bum] [l]ady (#1|A)/(#2|B)/(#2|C)/(#3|D)/(#4|E)
|
||||
else if (c == 'l' || (len > 2 && str[3] == 'l'))
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_BUM_LADY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_BUM_LADY_B;
|
||||
else if (d == '2' || d == 'c') return SQMOD_SKIN_BUM_LADY_C;
|
||||
else if (d == '3' || d == 'd') return SQMOD_SKIN_BUM_LADY_D;
|
||||
else if (d == '4' || d == 'e') return SQMOD_SKIN_BUM_LADY_E;
|
||||
}
|
||||
}
|
||||
// [Bus]iness [m]an (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
||||
else if (b == 'u' && (c == 's' || (len > 8 && str[9] == 'm')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_BUSINESS_MAN_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_BUSINESS_MAN_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_BUSINESS_MAN_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_BUSINESS_MAN_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_BUSINESS_MAN_E;
|
||||
case '6':
|
||||
case 'f': return SQMOD_SKIN_BUSINESS_MAN_F;
|
||||
}
|
||||
}
|
||||
// [C]am, [C]am (Robber), [C]andy Suxx, [C]hef
|
||||
// [C]hurch guy, [C]hurch lady, [C]lub lady
|
||||
// [C]olumbian guy (#1|A)/(#2|B),
|
||||
// [C]onstruction worker (#1|A)/(#2|B)
|
||||
// [C]ool guy (#1|A)/(#2|B)/(#3|C)/(#4|D)
|
||||
// [C]op, [C]ortez
|
||||
// [C]riminal (#1|A)/(#2|B)
|
||||
// [C]uban (#1|A)/(#2|B)
|
||||
case 'c':
|
||||
// [Ca]m, [Ca]m (Robber), [Ca]ndy Suxx
|
||||
if (b == 'a')
|
||||
{
|
||||
// [Cam] ([R]obbe[r])
|
||||
if (c && (c == 'm' || c == 'r') && d == 'r') return SQMOD_SKIN_CAM_ROBBER;
|
||||
// [Cam]
|
||||
else if (c == 'm') return SQMOD_SKIN_CAM;
|
||||
// [Can]dy [S]ux[x]
|
||||
else if (c && (c == 'n' || c == 's' || d == 'x')) return SQMOD_SKIN_CANDY_SUXX;
|
||||
}
|
||||
// [Ch]ef, [Ch]urch guy, [Ch]urch lady
|
||||
else if (b == 'h')
|
||||
{
|
||||
// [Che][f]
|
||||
if (c && (c == 'e' || d == 'f')) return SQMOD_SKIN_CHEF;
|
||||
// [Chu]rch [g]uy
|
||||
else if (c && ((c == 'u' && len > 5 && str[6] == 'g') || (c == 'g')))
|
||||
return SQMOD_SKIN_CHURCH_GUY;
|
||||
// [Chu]rch [l]ady
|
||||
else if (c && ((c == 'u' && len > 5 && str[6] == 'l') || (c == 'l')))
|
||||
return SQMOD_SKIN_CHURCH_LADY;
|
||||
}
|
||||
// [Cl]ub [l]ady
|
||||
else if (b == 'l') return SQMOD_SKIN_CLUB_LADY;
|
||||
// [Co]lumbian guy (#1|A)/(#2|B)
|
||||
// [Co]nstruction worker (#1|A)/(#2|B)
|
||||
// [Co]ol guy (#1|A)/(#2|B)/(#3|C)/(#4|D)
|
||||
// [Co]p, [Co]rtez
|
||||
else if (b == 'o')
|
||||
{
|
||||
// [Col]umbian [g]uy (#1|A)/(#2|B)
|
||||
if (c && ((c == 'l' && len > 8 && str[9] == 'g') || (c == 'g')))
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_COLUMBIAN_GUY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_COLUMBIAN_GUY_B;
|
||||
}
|
||||
// [Con]struction [w]orker (#1|A)/(#2|B)
|
||||
else if (c && (c == 'n' || (len > 11 && str[12] == 'g')))
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_CONSTRUCTION_WORKER_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_CONSTRUCTION_WORKER_B;
|
||||
}
|
||||
// [Coo]l guy (#1|A)/(#2|B)/(#3|C)/(#4|D)
|
||||
else if (c == 'o')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_COOL_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_COOL_GUY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_COOL_GUY_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_COOL_GUY_D;
|
||||
}
|
||||
}
|
||||
// [Cop]
|
||||
else if (c == 'p') return SQMOD_SKIN_COP;
|
||||
// [Cor]te[z]
|
||||
else if (c && (c == 'r' || c == 'z' || d == 'z')) return SQMOD_SKIN_CORTEZ;
|
||||
}
|
||||
// [Cr]iminal (#1|A)/(#2|B)
|
||||
else if (b == 'r' && (d == '1' || d == 'a')) return SQMOD_SKIN_CRIMINAL_A;
|
||||
else if (b == 'r' && (d == '2' || d == 'b')) return SQMOD_SKIN_CRIMINAL_B;
|
||||
// [Cu]ban (#1|A)/(#2|B)
|
||||
else if (b == 'u' && (d == '1' || d == 'a')) return SQMOD_SKIN_CUBAN_A;
|
||||
else if (b == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_CUBAN_B;
|
||||
// [D]BP security (#1|A)/(#2|B)
|
||||
// [D]iaz guy (#1|A)/(#2|B)
|
||||
case 'd':
|
||||
switch (b)
|
||||
{
|
||||
// [DB]P [s]ecurity (#1|A)/(#2|B)
|
||||
case 'b':
|
||||
case 's':
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_DBP_SECURITY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_DBP_SECURITY_B;
|
||||
// [Di]a[z] [g]uy (#1|A)/(#2|B)
|
||||
case 'i':
|
||||
case 'z':
|
||||
case 'g':
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_DIAZ_GUY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_DIAZ_GUY_B;
|
||||
}
|
||||
// [F]BI, [F]ireman, [F]ood lady, [F]rench guy
|
||||
case 'f':
|
||||
switch (b)
|
||||
{
|
||||
// [FB]I
|
||||
case 'b': return SQMOD_SKIN_FBI;
|
||||
// [Fi]re[m]an
|
||||
case 'i':
|
||||
case 'm': return SQMOD_SKIN_FIREMAN;
|
||||
// [Fo]od [l]ady
|
||||
case 'o':
|
||||
case 'l': return SQMOD_SKIN_FOOD_LADY;
|
||||
// [Fr]ench [g]uy
|
||||
case 'r':
|
||||
case 'g': return SQMOD_SKIN_FRENCH_GUY;
|
||||
}
|
||||
// [G]arbageman (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||
// [G]olf guy (#1|A)/(#2|B)/(#3|C)
|
||||
// [G]olf lady
|
||||
// [G]ranny (#1|A)/(#2|B)
|
||||
// [G]ym guy, [G]ym lady
|
||||
case 'g':
|
||||
// [Ga]rbage[m]an (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||
if (b && (b == 'a' || b == 'm'))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_GARBAGEMAN_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_GARBAGEMAN_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_GARBAGEMAN_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_GARBAGEMAN_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_GARBAGEMAN_E;
|
||||
}
|
||||
}
|
||||
// [Go]lf [g]uy (#1|A)/(#2|B)/(#3|C)
|
||||
else if (b == 'o' && ((c == 'g') || (len > 3 && str[4] == 'g')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_GOLF_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_GOLF_GUY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_GOLF_GUY_C;
|
||||
}
|
||||
}
|
||||
// [Go]lf [l]ady
|
||||
else if (b == 'o' && ((c == 'l') || (len > 3 && str[4] == 'l')))
|
||||
return SQMOD_SKIN_GOLF_LADY;
|
||||
// [Gr]anny (#1|A)/(#2|B)
|
||||
else if (b == 'r')
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_GRANNY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_GRANNY_B;
|
||||
}
|
||||
// [Gy]m [g]uy
|
||||
else if (b && (b == 'g' || (b == 'y' && len > 2 && str[3] == 'g')))
|
||||
return SQMOD_SKIN_GYM_GUY;
|
||||
// [Gy]m [l]ady
|
||||
else if (b && (b == 'l' || (b == 'y' && len > 2 && str[3] == 'l')))
|
||||
return SQMOD_SKIN_GYM_LADY;
|
||||
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||
// [H]ilary, [H]ilary (Robber), [H]ood lady
|
||||
case 'h':
|
||||
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||
if (b == 'a')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_HATIAN_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_HATIAN_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_HATIAN_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_HATIAN_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_HATIAN_E;
|
||||
}
|
||||
}
|
||||
// [Hi]lary ([R]obbe[r])
|
||||
else if (b && (b == 'i' || b == 'r') && d == 'r') return SQMOD_SKIN_HILARY_ROBBER;
|
||||
// [Hi]lary
|
||||
else if (b == 'i') return SQMOD_SKIN_HILARY;
|
||||
// [Ho]od [l]ady
|
||||
if (b && (b == 'o' || b == 'l')) return SQMOD_SKIN_HOOD_LADY;
|
||||
// [K]en Rosenburg
|
||||
case 'k':
|
||||
return SQMOD_SKIN_KEN_ROSENBURG;
|
||||
// [L]ance (#1|A)/(#1|B)
|
||||
// [L]ance (Cop)
|
||||
// [L]awyer
|
||||
// [L]ove Fist (#1|A)/(#2|B)/(#3|C)/(#3|D)
|
||||
case 'l':
|
||||
//[Lan]ce ([C]o[p])
|
||||
if ((b == 'a') && (c == 'n') && ((len > 4 && str[5] == 'c') || d == 'p'))
|
||||
return SQMOD_SKIN_LANCE_COP;
|
||||
else if (b && (b == 'c' || (b == 'a' && (c == 'n'))))
|
||||
return SQMOD_SKIN_LANCE_COP;
|
||||
// [La]nce (#1|A)/(#1|B)
|
||||
else if (b == 'a' && c == 'n')
|
||||
{
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_LANCE_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_LANCE_B;
|
||||
}
|
||||
// [Law]yer
|
||||
else if (b && (b == 'w' || (b == 'a' && c == 'w'))) return SQMOD_SKIN_LAWYER;
|
||||
// [Lo]ve [F]ist (#1|A)/(#2|B)/(#3|C)/(#3|D)
|
||||
else if (b && (b == 'o' || b == 'f'))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_LOVE_FIST_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_LOVE_FIST_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_LOVE_FIST_C;
|
||||
case 'd': return SQMOD_SKIN_LOVE_FIST_D;
|
||||
}
|
||||
}
|
||||
// [M]ercades
|
||||
case 'm':
|
||||
if (d == 'b') return SQMOD_SKIN_MERCADES_B;
|
||||
else return SQMOD_SKIN_MERCADES_A;
|
||||
// [O]ffice lady (#1|A)/(#2|B)
|
||||
case 'o':
|
||||
if (d == '1' || d == 'a') return SQMOD_SKIN_OFFICE_LADY_A;
|
||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_OFFICE_LADY_B;
|
||||
// [P]aramedic, [P]hil, [P]hil (One arm), [P]hil (Robber)
|
||||
// [P]imp, [P]izzaman
|
||||
// [P]rostitute (#1|A)/(#2|B)/(#2|C)/(#2|D)/(#3|D)/(#4|D)
|
||||
// [P]unk (#1|A)/(#2|B)/(#3|C)
|
||||
case 'p':
|
||||
// [Pa]ramedic
|
||||
if (b == 'a') return SQMOD_SKIN_PARAMEDIC;
|
||||
// [Ph]il (One arm), [Ph]il (Robber)
|
||||
else if (b == 'h')
|
||||
{
|
||||
// [Ph]il ([O]ne ar[m])
|
||||
if (b == 'o' || (c == 'o') || (len > 3 && str[4] == 'o') || d == 'm')
|
||||
return SQMOD_SKIN_PHIL_ONE_ARM;
|
||||
// [Ph]il ([R]obbe[r])
|
||||
else if (c && (c == 'r' || d == 'r' || (len > 3 && str[4] == 'r')))
|
||||
return SQMOD_SKIN_PHIL_ROBBER;
|
||||
// [Phi]l
|
||||
else if (c == 'i') return SQMOD_SKIN_PHIL;
|
||||
}
|
||||
// [Pim][p]
|
||||
else if (b == 'i' && ((c == 'm') || d == 'p')) return SQMOD_SKIN_PIMP;
|
||||
// [Piz]zama[n]
|
||||
else if (b == 'i' && ((c == 'z') || d == 'n')) return SQMOD_SKIN_PIZZAMAN;
|
||||
// [Pr]ostitute (#1|A)/(#2|B)/(#2|C)/(#2|D)/(#3|D)/(#4|D)
|
||||
else if (b == 'r')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_PROSTITUTE_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_PROSTITUTE_B;
|
||||
case 'c': return SQMOD_SKIN_PROSTITUTE_C;
|
||||
case 'd': return SQMOD_SKIN_PROSTITUTE_D;
|
||||
case '3':
|
||||
case 'e': return SQMOD_SKIN_PROSTITUTE_E;
|
||||
case '4':
|
||||
case 'f': return SQMOD_SKIN_PROSTITUTE_F;
|
||||
}
|
||||
}
|
||||
// [Pu]nk (#1|A)/(#2|B)/(#3|C)
|
||||
else if (b == 'u')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_PUNK_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_PUNK_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_PUNK_C;
|
||||
}
|
||||
}
|
||||
// [R]ich guy, [R]ockstar guy
|
||||
case 'r':
|
||||
// [Ri]ch guy
|
||||
if (b == 'i') return SQMOD_SKIN_RICH_GUY;
|
||||
// [Ro]ckstar guy
|
||||
else if (b == 'o') return SQMOD_SKIN_ROCKSTAR_GUY;
|
||||
// [S]ailor (#1|A)/(#2|B)/(#3|C)
|
||||
// [S]hark (#1|A)/(#2|B)
|
||||
// [S]hopper (#1|A)/(#2|B)
|
||||
// [S]kate guy, [S]kate lady, [S]onny
|
||||
// [S]onny guy (#1|A)/(#2|B)/(#3|C)
|
||||
// [S]pandEx (#1|A)/(#2|B)
|
||||
// [S]panish guy
|
||||
// [S]panish lady (#1|A)/(#2|B)/(#3|C)/(#4|D)
|
||||
// [S]tore clerk
|
||||
// [S]tripper (#1|A)/(#2|B)/(#3|C)
|
||||
// [S]wat
|
||||
case 's':
|
||||
// [Sa]ilor (#1|A)/(#2|B)/(#3|C)
|
||||
if (b == 'a')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SAILOR_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SAILOR_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_SAILOR_C;
|
||||
}
|
||||
}
|
||||
// [S]hark (#1|A)/(#2|B)
|
||||
else if (b == 'h' && c == 'a')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SHARK_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SHARK_B;
|
||||
}
|
||||
}
|
||||
// [S]hopper (#1|A)/(#2|B)
|
||||
else if (b == 'h' && c == 'o')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SHOPPER_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SHOPPER_B;
|
||||
}
|
||||
}
|
||||
// [Sk]ate [g]uy
|
||||
else if (b == 'k' && ((c == 'g') || (len > 4 && str[5] == 'g')))
|
||||
return SQMOD_SKIN_SKATE_GUY;
|
||||
// [Sk]ate [l]ady
|
||||
else if (b == 'k' && ((c == 'l') || (len > 4 && str[5] == 'l')))
|
||||
return SQMOD_SKIN_SKATE_LADY;
|
||||
// [So]nny
|
||||
// [So]nny guy (#1|A)/(#2|B)/(#3|C)
|
||||
else if (b == 'o')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SONNY_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SONNY_GUY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_SONNY_GUY_C;
|
||||
}
|
||||
}
|
||||
else if (b == 'g')
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SONNY_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SONNY_GUY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_SONNY_GUY_C;
|
||||
}
|
||||
}
|
||||
// [Sp]andE[x] (#1|A)/(#2|B)
|
||||
else if (b == 'p' && ((c == 'x') || (len > 5 && str[6] == 'x')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SPANDEX_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SPANDEX_GUY_B;
|
||||
}
|
||||
}
|
||||
// [Sp]anish [g]uy
|
||||
else if (b == 'p' && ((c == 'g') || (len > 6 && str[7] == 'g')))
|
||||
return SQMOD_SKIN_SPANISH_GUY;
|
||||
// [Sp]anish [l]ady (#1|A)/(#2|B)/(#3|C)/(#4|D)
|
||||
else if (b == 'p' && ((c == 'l') || (len > 6 && str[7] == 'l')))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_SPANISH_LADY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_SPANISH_LADY_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_SPANISH_LADY_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_SPANISH_LADY_D;
|
||||
}
|
||||
}
|
||||
// [Sto]re clerk
|
||||
else if ((b == 't') && (c == 'o')) return SQMOD_SKIN_STORE_CLERK;
|
||||
// [Str]ipper (#1|A)/(#2|B)/(#3|C)
|
||||
else if ((b == 't') && (c == 'r'))
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_STRIPPER_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_STRIPPER_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_STRIPPER_C;
|
||||
}
|
||||
}
|
||||
// [Sw]at
|
||||
else if (b == 'w') return SQMOD_SKIN_SWAT;
|
||||
// [T]axi driver (#1|A)/(#1|B)/(#2|C)/(#2|D)
|
||||
// [T]hug (#1|A)/(#2|B)
|
||||
// [T]ommy Vercetti
|
||||
// [T]ourist (#1|A)/(#2|B)
|
||||
// [T]ranny
|
||||
case 't':
|
||||
switch (b)
|
||||
{
|
||||
// [Ta]xi driver (#1|A)/(#1|B)/(#2|C)/(#2|D)
|
||||
case 'a':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_TAXI_DRIVER_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_TAXI_DRIVER_B;
|
||||
case 'c': return SQMOD_SKIN_TAXI_DRIVER_C;
|
||||
case 'd': return SQMOD_SKIN_TAXI_DRIVER_D;
|
||||
}
|
||||
// [Th]ug (#1|A)/(#2|B)
|
||||
case 'h':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_THUG_A;
|
||||
case '5':
|
||||
case 'b': return SQMOD_SKIN_THUG_B;
|
||||
}
|
||||
// [To]mmy [V]ercetti
|
||||
// [To]urist (#1|A)/(#2|B)
|
||||
case 'v': return SQMOD_SKIN_TOMMY_VERCETTI;
|
||||
case 'o':
|
||||
if (c == 'm') return SQMOD_SKIN_TOMMY_VERCETTI;
|
||||
else if (c == 'u' && (d == '1' || d == 'a')) return SQMOD_SKIN_TOURIST_A;
|
||||
else if (c == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_TOURIST_B;
|
||||
case 'r': return SQMOD_SKIN_TRANNY;
|
||||
}
|
||||
// [U]ndercover cop (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
||||
case 'u':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_UNDERCOVER_COP_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_UNDERCOVER_COP_B;
|
||||
case '3':
|
||||
case 'c': return SQMOD_SKIN_UNDERCOVER_COP_C;
|
||||
case '4':
|
||||
case 'd': return SQMOD_SKIN_UNDERCOVER_COP_D;
|
||||
case '5':
|
||||
case 'e': return SQMOD_SKIN_UNDERCOVER_COP_E;
|
||||
case '6':
|
||||
case 'f': return SQMOD_SKIN_UNDERCOVER_COP_F;
|
||||
}
|
||||
// [V]ercetti guy (#1|A)/(#2|B)
|
||||
case 'v':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_VERCETTI_GUY_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_VERCETTI_GUY_B;
|
||||
}
|
||||
// [W]aitress (#1|A)/(#2|B)
|
||||
case 'w':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_SKIN_WAITRESS_A;
|
||||
case '2':
|
||||
case 'b': return SQMOD_SKIN_WAITRESS_B;
|
||||
}
|
||||
// Default to unknown
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsSkinValid(Int32 id)
|
||||
{
|
||||
return (strlen(GetSkinName(id)) > 0);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & FindPlayer(Object & by)
|
||||
{
|
||||
switch (by.GetType())
|
||||
{
|
||||
case OT_INTEGER:
|
||||
return _Core->GetPlayer(by.Cast< Int32 >()).mObj;
|
||||
case OT_FLOAT:
|
||||
return _Core->GetPlayer(round(by.Cast< Float32 >())).mObj;
|
||||
case OT_STRING:
|
||||
{
|
||||
String str(by.Cast< String >());
|
||||
Int32 id = _Func->GetPlayerIDFromName(&str[0]);
|
||||
if (VALID_ENTITYEX(id, SQMOD_PLAYER_POOL))
|
||||
_Core->GetPlayer(id).mObj;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SqThrow("Unsupported search identifier");
|
||||
}
|
||||
return NullObject();
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
41
source/Misc/Player.hpp
Normal file
41
source/Misc/Player.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _MISC_PLAYER_HPP_
|
||||
#define _MISC_PLAYER_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetUseClasses(bool toggle);
|
||||
bool GetUseClasses(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 AddPlayerClass(Int32 team, const Color3 & color, Int32 skin, const Vector3 & pos, Float32 angle,
|
||||
Int32 w1, Int32 a1, Int32 w2, Int32 a2, Int32 w3, Int32 a3);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnPlayerPos(const Vector3 & pos);
|
||||
void SetSpawnPlayerPosEx(Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnCameraPos(const Vector3 & pos);
|
||||
void SetSpawnCameraPosEx(Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetSpawnCameraLookAt(const Vector3 & pos);
|
||||
void SetSpawnCameraLookAtEx(Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetSkinName(Uint32 id);
|
||||
void SetSkinName(Uint32 id, CCStr name);
|
||||
Int32 GetSkinID(CCStr name);
|
||||
bool IsSkinValid(Int32 id);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & FindPlayer(Object & by);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_PLAYER_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/PlayerImmunity.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CPlayerImmunity(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,185 +0,0 @@
|
||||
#ifndef _MISC_PLAYER_IMMUNITY_HPP_
|
||||
#define _MISC_PLAYER_IMMUNITY_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
struct CPlayerImmunity
|
||||
{
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity(const CPlayerImmunity & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity(CPlayerImmunity && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CPlayerImmunity();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity & operator = (const CPlayerImmunity & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity & operator = (CPlayerImmunity && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator == (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator != (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator < (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator > (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator <= (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator >= (const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CPlayerImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator SQInt32 () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator bool () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetFlags() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetFlags(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CPlayerImmunity & SetnGet(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Apply(const CPlayer & player) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetBullet() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetBullet(bool toggle);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetFire() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetFire(bool toggle);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetExplosion() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetExplosion(bool toggle);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetCollision() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetCollision(bool toggle);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool GetMelee() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetMelee(bool toggle);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void EnableAll();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void DisableAll();
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 m_Flags;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_PLAYER_IMMUNITY_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/Radio.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CRadio(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,147 +0,0 @@
|
||||
#ifndef _MISC_RADIO_HPP_
|
||||
#define _MISC_RADIO_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
class CRadio
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio(const CRadio & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio(CRadio && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CRadio();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio & operator= (const CRadio & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio & operator= (CRadio && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio operator+ (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio operator- (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio operator* (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio operator/ (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator == (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator != (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator < (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator > (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator <= (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator >= (const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CRadio & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator SQInt32 () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator bool () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CRadio & SetnGet(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Apply(const CVehicle & vehicle) const;
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_RADIO_HPP_
|
146
source/Misc/Register.cpp
Normal file
146
source/Misc/Register.cpp
Normal file
@@ -0,0 +1,146 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Base/Color3.hpp"
|
||||
#include "Base/Vector2.hpp"
|
||||
#include "Base/Vector3.hpp"
|
||||
#include "Entity/Player.hpp"
|
||||
#include "Library/Numeric.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Functions.hpp"
|
||||
#include "Misc/Model.hpp"
|
||||
#include "Misc/Player.hpp"
|
||||
#include "Misc/Vehicle.hpp"
|
||||
#include "Misc/Weapon.hpp"
|
||||
#include "Misc/World.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ================================================================================================
|
||||
void Register_Misc(HSQUIRRELVM vm)
|
||||
{
|
||||
Table srvns(vm);
|
||||
|
||||
srvns.Func(_SC("SetTimeRate"), &SetTimeRate)
|
||||
.Func(_SC("GetTimeRate"), &GetTimeRate)
|
||||
.Func(_SC("SetHour"), &SetHour)
|
||||
.Func(_SC("GetHour"), &GetHour)
|
||||
.Func(_SC("SetMinute"), &SetMinute)
|
||||
.Func(_SC("GetMinute"), &GetMinute)
|
||||
.Func(_SC("SetWeather"), &SetWeather)
|
||||
.Func(_SC("GetWeather"), &GetWeather)
|
||||
.Func(_SC("SetGravity"), &SetGravity)
|
||||
.Func(_SC("GetGravity"), &GetGravity)
|
||||
.Func(_SC("SetGamespeed"), &SetGamespeed)
|
||||
.Func(_SC("GetGamespeed"), &GetGamespeed)
|
||||
.Func(_SC("SetWaterLevel"), &SetWaterLevel)
|
||||
.Func(_SC("GetWaterLevel"), &GetWaterLevel)
|
||||
.Func(_SC("SetMaxHeight"), &SetMaxHeight)
|
||||
.Func(_SC("GetMaxHeight"), &GetMaxHeight)
|
||||
.Func(_SC("SetKillCmdDelay"), &SetKillCmdDelay)
|
||||
.Func(_SC("GetKillCmdDelay"), &GetKillCmdDelay)
|
||||
.Func(_SC("SetVehiclesForcedRespawnHeight"), &SetVehiclesForcedRespawnHeight)
|
||||
.Func(_SC("GetVehiclesForcedRespawnHeight"), &GetVehiclesForcedRespawnHeight)
|
||||
.Func(_SC("ToggleSyncFrameLimiter"), &ToggleSyncFrameLimiter)
|
||||
.Func(_SC("EnabledSyncFrameLimiter"), &EnabledSyncFrameLimiter)
|
||||
.Func(_SC("ToggleFrameLimiter"), &ToggleFrameLimiter)
|
||||
.Func(_SC("EnabledFrameLimiter"), &EnabledFrameLimiter)
|
||||
.Func(_SC("ToggleTaxiBoostJump"), &ToggleTaxiBoostJump)
|
||||
.Func(_SC("EnabledTaxiBoostJump"), &EnabledTaxiBoostJump)
|
||||
.Func(_SC("ToggleDriveOnWater"), &ToggleDriveOnWater)
|
||||
.Func(_SC("EnabledDriveOnWater"), &EnabledDriveOnWater)
|
||||
.Func(_SC("ToggleFastSwitch"), &ToggleFastSwitch)
|
||||
.Func(_SC("EnabledFastSwitch"), &EnabledFastSwitch)
|
||||
.Func(_SC("ToggleFriendlyFire"), &ToggleFriendlyFire)
|
||||
.Func(_SC("EnabledFriendlyFire"), &EnabledFriendlyFire)
|
||||
.Func(_SC("ToggleDisableDriveby"), &ToggleDisableDriveby)
|
||||
.Func(_SC("EnabledDisableDriveby"), &EnabledDisableDriveby)
|
||||
.Func(_SC("TogglePerfectHandling"), &TogglePerfectHandling)
|
||||
.Func(_SC("EnabledPerfectHandling"), &EnabledPerfectHandling)
|
||||
.Func(_SC("ToggleFlyingCars"), &ToggleFlyingCars)
|
||||
.Func(_SC("EnabledFlyingCars"), &EnabledFlyingCars)
|
||||
.Func(_SC("ToggleJumpSwitch"), &ToggleJumpSwitch)
|
||||
.Func(_SC("EnabledJumpSwitch"), &EnabledJumpSwitch)
|
||||
.Func(_SC("ToggleShowMarkers"), &ToggleShowMarkers)
|
||||
.Func(_SC("EnabledShowMarkers"), &EnabledShowMarkers)
|
||||
.Func(_SC("ToggleStuntBike"), &ToggleStuntBike)
|
||||
.Func(_SC("EnabledStuntBike"), &EnabledStuntBike)
|
||||
.Func(_SC("ToggleShootInAir"), &ToggleShootInAir)
|
||||
.Func(_SC("EnabledShootInAir"), &EnabledShootInAir)
|
||||
.Func(_SC("ToggleShowNametags"), &ToggleShowNametags)
|
||||
.Func(_SC("EnabledShowNametags"), &EnabledShowNametags)
|
||||
.Func(_SC("ToggleJoinMessages"), &ToggleJoinMessages)
|
||||
.Func(_SC("EnabledJoinMessages"), &EnabledJoinMessages)
|
||||
.Func(_SC("ToggleDeathMessages"), &ToggleDeathMessages)
|
||||
.Func(_SC("EnabledDeathMessages"), &EnabledDeathMessages)
|
||||
.Func(_SC("ToggleChatTagsByDefaultEnabled"), &ToggleChatTagsByDefaultEnabled)
|
||||
.Func(_SC("EnabledChatTagsByDefault"), &EnabledChatTagsByDefault)
|
||||
.Func(_SC("CreateExplosion"), &CreateExplosion)
|
||||
.Func(_SC("CreateExplosionEx"), &CreateExplosionEx)
|
||||
.Func(_SC("HideMapObject"), &HideMapObject)
|
||||
.Func(_SC("HideMapObjectEx"), &HideMapObjectEx)
|
||||
.Func(_SC("ShowMapObject"), &ShowMapObject)
|
||||
.Func(_SC("ShowMapObjectEx"), &ShowMapObjectEx)
|
||||
.Func(_SC("ShowAllMapObjects"), &ShowAllMapObjects)
|
||||
.Func(_SC("SetWastedSettings"), &SetWastedSettings)
|
||||
.Func(_SC("GetWastedSettings"), &GetWastedSettings)
|
||||
.Func(_SC("SetWorldBounds"), &SetWorldBounds)
|
||||
.Func(_SC("SetWorldBoundsEx"), &SetWorldBoundsEx)
|
||||
.Func(_SC("GetWorldBounds"), &GetWorldBounds)
|
||||
.Func(_SC("GetPluginVersion"), &GetPluginVersion)
|
||||
.Func(_SC("GetPluginVersionStr"), &GetPluginVersionStr)
|
||||
.Func(_SC("GetPluginName"), &GetPluginName)
|
||||
.Func(_SC("GetPluginAuthor"), &GetPluginAuthor)
|
||||
.Func(_SC("GetPluginID"), &GetPluginID)
|
||||
.Func(_SC("GetNumberOfPlugins"), &GetNumberOfPlugins)
|
||||
.Func(_SC("FindPlugin"), &FindPlugin)
|
||||
.Func(_SC("GetVersion"), &GetServerVersion)
|
||||
.Func(_SC("GetPort"), &GetServerPort)
|
||||
.Func(_SC("GetFlags"), &GetServerFlags)
|
||||
.Func(_SC("SetName"), &SetServerName)
|
||||
.Func(_SC("GetName"), &GetServerName)
|
||||
.Func(_SC("GetTime"), &GetTime)
|
||||
.Func(_SC("SendCustomCommand"), &SendCustomCommand)
|
||||
.Func(_SC("SetMaxPlayers"), &SetMaxPlayers)
|
||||
.Func(_SC("GetMaxPlayers"), &GetMaxPlayers)
|
||||
.Func(_SC("SetServerPassword"), &SetServerPassword)
|
||||
.Func(_SC("GetServerPassword"), &GetServerPassword)
|
||||
.Func(_SC("SetGameModeText"), &SetGameModeText)
|
||||
.Func(_SC("GetGameModeText"), &GetGameModeText)
|
||||
.Func(_SC("AddRadioStream"), &AddRadioStream)
|
||||
.Func(_SC("RemoveRadioStream"), &RemoveRadioStream);
|
||||
|
||||
RootTable(vm).Bind(_SC("Server"), srvns);
|
||||
|
||||
RootTable(vm)
|
||||
.Func(_SC("GetModelName"), &GetModelName)
|
||||
.Func(_SC("SetModelName"), &SetModelName)
|
||||
.Func(_SC("IsModelWeapon"), &IsModelWeapon)
|
||||
.Func(_SC("IsModelActuallyWeapon"), &IsModelActuallyWeapon)
|
||||
.Func(_SC("IsWeaponNatural"), &IsWeaponNatural)
|
||||
.Func(_SC("SetUseClasses"), &SetUseClasses)
|
||||
.Func(_SC("GetUseClasses"), &GetUseClasses)
|
||||
.Func(_SC("AddPlayerClass"), &AddPlayerClass)
|
||||
.Func(_SC("SetSpawnPlayerPos"), &SetSpawnPlayerPos)
|
||||
.Func(_SC("SetSpawnPlayerPosEx"), &SetSpawnPlayerPosEx)
|
||||
.Func(_SC("SetSpawnCameraPos"), &SetSpawnCameraPos)
|
||||
.Func(_SC("SetSpawnCameraPosEx"), &SetSpawnCameraPosEx)
|
||||
.Func(_SC("GetSkinName"), &GetSkinName)
|
||||
.Func(_SC("SetSkinName"), &SetSkinName)
|
||||
.Func(_SC("GetSkinID"), &GetSkinID)
|
||||
.Func(_SC("IsSkinValid"), &IsSkinValid)
|
||||
.Func(_SC("FindPlayer"), &FindPlayer)
|
||||
.Func(_SC("GetAutomobileName"), &GetAutomobileName)
|
||||
.Func(_SC("SetAutomobileName"), &SetAutomobileName)
|
||||
.Func(_SC("GetAutomobileID"), &GetAutomobileID)
|
||||
.Func(_SC("IsAutomobileValid"), &IsAutomobileValid)
|
||||
.Func(_SC("GetWeaponName"), &GetWeaponName)
|
||||
.Func(_SC("SetWeaponName"), &SetWeaponName)
|
||||
.Func(_SC("GetWeaponID"), &GetWeaponID)
|
||||
.Func(_SC("IsWeaponValid"), &IsWeaponValid)
|
||||
.Func(_SC("WeaponToModel"), &WeaponToModel)
|
||||
.Func(_SC("PlaySound"), &PlaySound)
|
||||
.Func(_SC("PlaySoundEx"), &PlaySoundEx);
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
File diff suppressed because it is too large
Load Diff
@@ -1,187 +0,0 @@
|
||||
#ifndef _MISC_SHARED_HPP_
|
||||
#define _MISC_SHARED_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <array>
|
||||
#include <utility>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to convert the specified key code to a name.
|
||||
*/
|
||||
const SQChar * GetKeyCodeName(SQInt32 keycode);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attemp to convert the specified model identifier to a name.
|
||||
*/
|
||||
const SQChar * GetModelName(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified model identifier points to model that is used to represent weapons.
|
||||
*/
|
||||
bool IsModelWeapon(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified model identifier points to model that is used to represent
|
||||
* an actual weapon.
|
||||
*/
|
||||
bool IsModelActuallyWeapon(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified model identifier is valid.
|
||||
*/
|
||||
bool IsModelValid(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attemp to convert the specified player skin identifier to a name.
|
||||
*/
|
||||
const SQChar * GetSkinName(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to convert the specified player skin name to an identifier.
|
||||
*/
|
||||
SQInt32 GetSkinID(const SQChar * name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified player skin identifier is valid.
|
||||
*/
|
||||
bool IsSkinValid(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attemp to convert the specified vehicle model identifier to a name.
|
||||
*/
|
||||
const SQChar * GetAutomobileName(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to convert the specified vehicle model name to an identifier.
|
||||
*/
|
||||
SQInt32 GetAutomobileID(const SQChar * name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified vehicle model identifier is valid.
|
||||
*/
|
||||
bool IsAutomobileValid(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attemp to convert the specified weapon identifier to a name.
|
||||
*/
|
||||
const SQChar * GetWeaponName(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to convert the specified weapon name to an identifier.
|
||||
*/
|
||||
SQInt32 GetWeaponID(const SQChar * name);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified weapon identifier is valid.
|
||||
*/
|
||||
bool IsWeaponValid(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* See whether the specified weapon identifier points to a weapon that may not be used by
|
||||
* another player to perform a kill. Such as a player fall, drown, explosion etc.
|
||||
*/
|
||||
bool IsWeaponNatural(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Attempt to convert the weapon identifier to it's corresponding model identifier.
|
||||
*/
|
||||
SQInt32 WeaponToModel(SQInt32 id);
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Helper class used to associate a tag and arbitrary data to an identifier.
|
||||
*/
|
||||
template < class T, unsigned N > class IdentifierStorage
|
||||
{
|
||||
public:
|
||||
// --------------------------------------------------------------------------------------------
|
||||
static constexpr SQInt32 Max = N;
|
||||
|
||||
protected:
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
typedef std::array< std::pair< SqTag, SqObj >, N > GlobalStorage;
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
static GlobalStorage s_Globals;
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global tag.
|
||||
*/
|
||||
static const SQChar * GlobalTag(SQUint32 id)
|
||||
{
|
||||
if (id < N)
|
||||
{
|
||||
return s_Globals[id].first.c_str();
|
||||
}
|
||||
|
||||
return _SC("");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global tag.
|
||||
*/
|
||||
static void GlobalTag(SQUint32 id, const SQChar * tag)
|
||||
{
|
||||
if (id < N)
|
||||
{
|
||||
s_Globals[id].first.assign(tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr("Attempting to set global tag for invalid automobile id: %d", id);
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global data.
|
||||
*/
|
||||
static SqObj & GlobalData(SQUint32 id)
|
||||
{
|
||||
if (id < N)
|
||||
{
|
||||
return s_Globals[id].second;
|
||||
}
|
||||
return NullData();
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global data.
|
||||
*/
|
||||
static void GlobalData(SQUint32 id, SqObj & data)
|
||||
{
|
||||
if (id < N)
|
||||
{
|
||||
s_Globals[id].second = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr("Attempting to set global data for invalid automobile id: %d", id);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the specified identifier is valid and in bounds.
|
||||
*/
|
||||
static bool Valid(SQInt32 id)
|
||||
{
|
||||
return VALID_ENTITYGETEX(id, Max);
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template < class T, unsigned N >
|
||||
typename IdentifierStorage< T, N >::GlobalStorage IdentifierStorage< T, N >::s_Globals;
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_SHARED_HPP_
|
@@ -1,268 +0,0 @@
|
||||
#include "Misc/Skin.hpp"
|
||||
#include "Register.hpp"
|
||||
#include "Entity.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const CSkin CSkin::NIL = CSkin();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin::CSkin()
|
||||
: m_ID(SQMOD_UNKNOWN)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CSkin::CSkin(SQInt32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, Max))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CSkin::CSkin(const SQChar * name, SQInt32 id)
|
||||
: m_ID(GetSkinID(name))
|
||||
{
|
||||
if (VALID_ENTITYEX(m_ID, Max))
|
||||
{
|
||||
m_ID = id;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin::CSkin(const CSkin & s)
|
||||
: m_ID(s.m_ID)
|
||||
, m_Tag(s.m_Tag)
|
||||
, m_Data(s.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CSkin::CSkin(CSkin && s)
|
||||
: m_ID(s.m_ID)
|
||||
, m_Tag(s.m_Tag)
|
||||
, m_Data(s.m_Data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin::~CSkin()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin & CSkin::operator = (const CSkin & s)
|
||||
{
|
||||
m_ID = s.m_ID;
|
||||
m_Tag = s.m_Tag;
|
||||
m_Data = s.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CSkin & CSkin::operator = (CSkin && s)
|
||||
{
|
||||
m_ID = s.m_ID;
|
||||
m_Tag = s.m_Tag;
|
||||
m_Data = s.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin & CSkin::operator = (SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CSkin::operator == (const CSkin & s) const
|
||||
{
|
||||
return (m_ID == s.m_ID);
|
||||
}
|
||||
|
||||
bool CSkin::operator != (const CSkin & s) const
|
||||
{
|
||||
return (m_ID != s.m_ID);
|
||||
}
|
||||
|
||||
bool CSkin::operator < (const CSkin & s) const
|
||||
{
|
||||
return (m_ID < s.m_ID);
|
||||
}
|
||||
|
||||
bool CSkin::operator > (const CSkin & s) const
|
||||
{
|
||||
return (m_ID < s.m_ID);
|
||||
}
|
||||
|
||||
bool CSkin::operator <= (const CSkin & s) const
|
||||
{
|
||||
return (m_ID <= s.m_ID);
|
||||
}
|
||||
|
||||
bool CSkin::operator >= (const CSkin & s) const
|
||||
{
|
||||
return (m_ID >= s.m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CSkin::Cmp(const CSkin & s) const
|
||||
{
|
||||
if (m_ID == s.m_ID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (m_ID > s.m_ID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CSkin::ToString() const
|
||||
{
|
||||
return GetSkinName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CSkin::GetID() const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
void CSkin::SetID(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSkin & CSkin::SetnGet(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CSkin::GetGlobalTag() const
|
||||
{
|
||||
return GlobalTag(m_ID);
|
||||
}
|
||||
|
||||
void CSkin::SetGlobalTag(const SQChar * tag) const
|
||||
{
|
||||
GlobalTag(m_ID, tag);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CSkin::GetGlobalData() const
|
||||
{
|
||||
return GlobalData(m_ID);
|
||||
}
|
||||
|
||||
void CSkin::SetGlobalData(SqObj & data) const
|
||||
{
|
||||
GlobalData(m_ID, data);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CSkin::GetLocalTag() const
|
||||
{
|
||||
return m_Tag.c_str();
|
||||
}
|
||||
|
||||
void CSkin::SetLocalTag(const SQChar * tag)
|
||||
{
|
||||
m_Tag = tag;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CSkin::GetLocalData()
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
|
||||
void CSkin::SetLocalData(SqObj & data)
|
||||
{
|
||||
m_Data = data;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CSkin::IsValid() const
|
||||
{
|
||||
return (m_ID > 0);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CSkin::GetName() const
|
||||
{
|
||||
return GetSkinName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CSkin::SetName(const SQChar * name)
|
||||
{
|
||||
m_ID = GetSkinID(name);
|
||||
m_ID = VALID_ENTITYGETEX(m_ID, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CSkin::Apply(const Reference< CPlayer > & player) const
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
_Func->SetPlayerSkin(player, m_ID);
|
||||
}
|
||||
else if (!player)
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player skin> using an invalid argument: {0:d}"), _SCI32(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player skin> using an invalid instance: {0:d}"), m_ID);
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_CSkin(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <CSkin> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("CSkin"), Sqrat::Class< CSkin >(vm, _SC("CSkin"))
|
||||
/* Constructors */
|
||||
.Ctor()
|
||||
.Ctor< SQInt32 >()
|
||||
.Ctor< const SQChar *, SQInt32 >()
|
||||
/* Metamethods */
|
||||
.Func(_SC("_cmp"), &CSkin::Cmp)
|
||||
.Func(_SC("_tostring"), &CSkin::ToString)
|
||||
/* Properties */
|
||||
.Prop(_SC("id"), &CSkin::GetID, &CSkin::SetID)
|
||||
.Prop(_SC("gtag"), &CSkin::GetGlobalTag, &CSkin::SetGlobalTag)
|
||||
.Prop(_SC("gdata"), &CSkin::GetGlobalData, &CSkin::SetGlobalData)
|
||||
.Prop(_SC("ltag"), &CSkin::GetLocalTag, &CSkin::SetLocalTag)
|
||||
.Prop(_SC("ldata"), &CSkin::GetLocalData, &CSkin::SetLocalData)
|
||||
.Prop(_SC("valid"), &CSkin::IsValid)
|
||||
.Prop(_SC("name"), &CSkin::GetName, &CSkin::SetName)
|
||||
/* Functions */
|
||||
.Func(_SC("setng"), &CSkin::SetnGet)
|
||||
.Func(_SC("apply"), &CSkin::Apply)
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CSkin> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,235 +0,0 @@
|
||||
#ifndef _MISC_SKIN_HPP_
|
||||
#define _MISC_SKIN_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Shared.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Class responsible for managing and interacting with skin models.
|
||||
*/
|
||||
class CSkin : public IdentifierStorage< CSkin, SQMOD_SKINID_CAP >
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Helper member for times when a null reference to an instance of this type is needed.
|
||||
*/
|
||||
static const CSkin NIL;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Default constructor.
|
||||
*/
|
||||
CSkin();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the specified skin.
|
||||
*/
|
||||
CSkin(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the skin extracted from the specified name.
|
||||
*/
|
||||
CSkin(const SQChar * name, SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy constructor.
|
||||
*/
|
||||
CSkin(const CSkin & s);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move constructor.
|
||||
*/
|
||||
CSkin(CSkin && s);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*/
|
||||
~CSkin();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy assignment operator.
|
||||
*/
|
||||
CSkin & operator = (const CSkin & s);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move assignment operator.
|
||||
*/
|
||||
CSkin & operator = (CSkin && s);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Skin identifier assignment operator.
|
||||
*/
|
||||
CSkin & operator = (SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Equality comparison operator.
|
||||
*/
|
||||
bool operator == (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Inequality comparison operator.
|
||||
*/
|
||||
bool operator != (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than comparison operator.
|
||||
*/
|
||||
bool operator < (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than comparison operator.
|
||||
*/
|
||||
bool operator > (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than or equal comparison operator.
|
||||
*/
|
||||
bool operator <= (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than or equal comparison operator.
|
||||
*/
|
||||
bool operator >= (const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to skin identifier.
|
||||
*/
|
||||
operator SQInt32 () const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to skin identifier.
|
||||
*/
|
||||
operator Int64 () const
|
||||
{
|
||||
return _SCI64(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to boolean.
|
||||
*/
|
||||
operator bool () const
|
||||
{
|
||||
return IsSkinValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Negation operator.
|
||||
*/
|
||||
bool operator ! () const
|
||||
{
|
||||
return !IsSkinValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script to compare two instances of this type.
|
||||
*/
|
||||
SQInteger Cmp(const CSkin & s) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Convert this type to a string.
|
||||
*/
|
||||
const SQChar * ToString() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier referenced by this instance.
|
||||
*/
|
||||
SQInteger GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier referenced by this instance.
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the identifier that this insance should reference and
|
||||
* get a reference to the instance to chain operations.
|
||||
*/
|
||||
CSkin & SetnGet(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global tag.
|
||||
*/
|
||||
const SQChar * GetGlobalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global tag.
|
||||
*/
|
||||
void SetGlobalTag(const SQChar * tag) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global data.
|
||||
*/
|
||||
SqObj & GetGlobalData() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global data.
|
||||
*/
|
||||
void SetGlobalData(SqObj & data) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local tag.
|
||||
*/
|
||||
const SQChar * GetLocalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local tag.
|
||||
*/
|
||||
void SetLocalTag(const SQChar * tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local data.
|
||||
*/
|
||||
SqObj & GetLocalData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local data.
|
||||
*/
|
||||
void SetLocalData(SqObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the referenced skin identifier is valid.
|
||||
*/
|
||||
bool IsValid() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the name of the referenced skin.
|
||||
*/
|
||||
const SQChar * GetName() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier of the referenced skin.
|
||||
*/
|
||||
void SetName(const SQChar * name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Apply the referenced skin identifier to the specified player instance.
|
||||
*/
|
||||
void Apply(const Reference< CPlayer > & player) const;
|
||||
|
||||
private:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The identifier of the referenced skin.
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local tag associated with this instance.
|
||||
*/
|
||||
SqTag m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local data associated with this instance.
|
||||
*/
|
||||
SqObj m_Data;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_SKIN_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/Sound.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CSound(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,142 +0,0 @@
|
||||
#ifndef _MISC_SOUND_HPP_
|
||||
#define _MISC_SOUND_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
class CSound
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound(const CSound & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound(CSound && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CSound();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound & operator= (const CSound & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound & operator= (CSound && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound operator+ (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound operator- (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound operator* (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CSound operator/ (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator == (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator != (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator < (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator > (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator <= (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator >= (const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CSound & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator SQInt32 () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator bool () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Play() const;
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_SOUND_HPP_
|
668
source/Misc/Vehicle.cpp
Normal file
668
source/Misc/Vehicle.cpp
Normal file
@@ -0,0 +1,668 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Vehicle.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static String CS_Vehicle_Names[] = {
|
||||
"Landstalker", "Idaho", "Stinger", "Linerunner", "Perennial",
|
||||
"Sentinel", "Rio", "Firetruck", "Trashmaster", "Stretch",
|
||||
"Manana", "Infernus", "Voodoo", "Pony", "Mule",
|
||||
"Cheetah", "Ambulance", "FBI Washington", "Moonbeam", "Esperanto",
|
||||
"Taxi", "Washington", "Bobcat", "Mr. Whoopee", "BF Injection",
|
||||
"Hunter", "Police", "Enforcer", "Securicar", "Banshee",
|
||||
"Predator", "Bus", "Rhino", "Barracks OL", "Cuban Hermes",
|
||||
"Helicopter", "Angel", "Coach", "Cabbie", "Stallion",
|
||||
"Rumpo", "RC Bandit", "Romero's Hearse", "Packer", "Sentinel XS",
|
||||
"Admiral", "Squalo", "Sea Sparrow", "Pizza Boy", "Gang Burrito",
|
||||
"Airtrain", "Deaddodo", "Speeder", "Reefer", "Tropic",
|
||||
"Flatbed", "Yankee", "Caddy", "Zebra Cab", "Top Fun",
|
||||
"Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron",
|
||||
"RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
|
||||
"Patriot", "Love Fist", "Coast Guard", "Dinghy", "Hermes",
|
||||
"Sabre", "Sabre Turbo", "Phoenix", "Walton", "Regina",
|
||||
"Comet", "Deluxo", "Burrito", "Spand Express", "Marquis",
|
||||
"Baggage Handler", "Kaufman Cab", "Maverick", "VCN Maverick", "Rancher",
|
||||
"FBI Rancher", "Virgo", "Greenwood", "Cuban Jetmax", "Hotring Racer #1",
|
||||
"Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson",
|
||||
"Mesa Grande", "RC Goblin", "Hotring Racer #2", "Hotring Racer #3", "Bloodring Banger #1",
|
||||
"Bloodring Banger #2", "Vice Squad Cheetah", ""
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetAutomobileName(Uint32 id)
|
||||
{
|
||||
return (id < 130 || id > 236) ? _SC("") : CS_Vehicle_Names[id-130].c_str();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetAutomobileName(Uint32 id, CCStr name)
|
||||
{
|
||||
if (id >= 130 || id <= 236)
|
||||
CS_Vehicle_Names[id-130].assign(name);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetAutomobileID(CCStr name)
|
||||
{
|
||||
// Clone the string into an editable version
|
||||
String str(name);
|
||||
// Strip non alphanumeric characters from the name
|
||||
str.erase(std::remove_if(str.begin(), str.end(), std::not1(std::ptr_fun(::isalnum))), str.end());
|
||||
// Convert the string to lowercase
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
// See if we still have a valid name after the cleanup
|
||||
if(str.empty())
|
||||
return SQMOD_UNKNOWN;
|
||||
// Grab the actual length of the string
|
||||
Uint32 len = static_cast< Uint32 >(str.length());
|
||||
// Get the most significant characters used to identify a vehicle
|
||||
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
||||
// Look for deeper specifiers
|
||||
if(str.length() >= 3)
|
||||
{
|
||||
c = str[2];
|
||||
b = str[1];
|
||||
}
|
||||
else if(str.length() >= 2)
|
||||
b = str[1];
|
||||
// Search for a pattern in the name
|
||||
switch (a)
|
||||
{
|
||||
// [A]dmiral
|
||||
// [A]irtrain
|
||||
// [A]mbulance
|
||||
// [A]ngel
|
||||
case 'a':
|
||||
switch (b)
|
||||
{
|
||||
// [Ad]miral
|
||||
case 'd': return SQMOD_VEHICLE_ADMIRAL;
|
||||
// [Ai]rtrain
|
||||
case 'i': return SQMOD_VEHICLE_AIRTRAIN;
|
||||
// [Am]bulance
|
||||
case 'm': return SQMOD_VEHICLE_AMBULANCE;
|
||||
// [An]gel
|
||||
case 'n': return SQMOD_VEHICLE_ANGEL;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
|
||||
// [B]aggage Handler
|
||||
// [B]anshee
|
||||
// [B]arracks OL
|
||||
// [B]enson
|
||||
// [B]F Injection
|
||||
// [B]lista Compact
|
||||
// [B]loodring Banger #1
|
||||
// [B]loodring Banger #2
|
||||
// [B]obcat
|
||||
// [B]oxville
|
||||
// [B]urrito
|
||||
// [B]us
|
||||
case 'b':
|
||||
switch (b)
|
||||
{
|
||||
// [Ba]ggage Handler
|
||||
// [Ba]nshee
|
||||
// [Ba]rracks OL
|
||||
case 'a':
|
||||
// [Bag]gage Handler
|
||||
if (c == 'g') return SQMOD_VEHICLE_BAGGAGEHANDLER;
|
||||
// [Ban]shee
|
||||
else if (c == 'n') return SQMOD_VEHICLE_BANSHEE;
|
||||
// [Bar]racks OL
|
||||
else if (c == 'r') return SQMOD_VEHICLE_BARRACKS;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Be]nson
|
||||
case 'e': return SQMOD_VEHICLE_BENSON;
|
||||
// [BF] [I]njection
|
||||
case 'f':
|
||||
case 'i': return SQMOD_VEHICLE_BFINJECTION;
|
||||
// [Bl]ista Compact
|
||||
// [Bl]oodring Banger #1
|
||||
// [Bl]oodring Banger #2
|
||||
case 'l':
|
||||
// [Bli]sta [C]ompact
|
||||
if (b == 'c' || c == 'i') return SQMOD_VEHICLE_BLISTACOMPACT;
|
||||
// [Blo]odring [B]anger (#1|A)
|
||||
else if ((b == 'b' || c == 'o') && (d == '1' || d == 'a')) return SQMOD_VEHICLE_BLOODRINGBANGER1;
|
||||
// [Blo]odring [B]anger (#2|B)
|
||||
else if ((b == 'b' || c == 'o') && (d == '2' || d == 'b')) return SQMOD_VEHICLE_BLOODRINGBANGER2;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Bo]bcat
|
||||
// [Bo]xville
|
||||
case 'o':
|
||||
// [Bob]cat
|
||||
if (c == 'b') return SQMOD_VEHICLE_BOBCAT;
|
||||
// [Box]ville
|
||||
else if (c == 'x') return SQMOD_VEHICLE_BOXVILLE;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Bu]rrito
|
||||
// [Bu]s
|
||||
case 'u':
|
||||
// [Bur]rito
|
||||
if (c == 'r') return SQMOD_VEHICLE_BURRITO;
|
||||
// [Bus]
|
||||
else if (c == 's') return SQMOD_VEHICLE_BUS;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [C]abbie
|
||||
// [C]addy
|
||||
// [C]heetah
|
||||
// [C]oach
|
||||
// [C]oast Guard
|
||||
// [C]omet
|
||||
// [C]uban Hermes
|
||||
// [C]uban Jetmax
|
||||
case 'c':
|
||||
switch (b)
|
||||
{
|
||||
// [Ca]bbie
|
||||
// [Ca]ddy
|
||||
case 'a':
|
||||
// [Cab]bie
|
||||
if (c == 'b') return SQMOD_VEHICLE_CABBIE;
|
||||
// [Cad]dy
|
||||
else if (c == 'd') return SQMOD_VEHICLE_CADDY;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Ch]eetah
|
||||
case 'h': return SQMOD_VEHICLE_CHEETAH;
|
||||
// [Co]ach
|
||||
// [Co]ast Guard
|
||||
// [Co]met
|
||||
case 'o':
|
||||
// [Coa]c[h]
|
||||
if (c == 'a' && d == 'h') return SQMOD_VEHICLE_COACH;
|
||||
// [Coa]s[t] Guar[d]
|
||||
else if (c == 'a' && (d == 't' || d == 'd')) return SQMOD_VEHICLE_COASTGUARD;
|
||||
// [Co]met
|
||||
else if (c == 'm') return SQMOD_VEHICLE_COMET;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Cu]ban Hermes
|
||||
// [Cu]ban Jetmax
|
||||
case 'u':
|
||||
// [Cub]an [H]erme[s]
|
||||
if ((len > 4 && str[5] == 'h') || (d == 's' || d == 'h')) return SQMOD_VEHICLE_CUBANHERMES;
|
||||
// [Cub]an [J]etma[x]
|
||||
if ((len > 4 && str[5] == 'j') || (d == 'x' || d == 'j')) return SQMOD_VEHICLE_CUBANJETMAX;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [D]eaddodo
|
||||
// [D]eluxo
|
||||
// [D]inghy
|
||||
case 'd':
|
||||
switch (b)
|
||||
{
|
||||
// [De]addodo
|
||||
// [De]luxo
|
||||
case 'e':
|
||||
// [Dea]ddodo
|
||||
if (c == 'a') return SQMOD_VEHICLE_DEADDODO;
|
||||
// [Del]uxo
|
||||
else if (c == 'l') return SQMOD_VEHICLE_DELUXO;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Di]nghy
|
||||
case 'i': return SQMOD_VEHICLE_DINGHY;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [E]speranto
|
||||
// [E]nforcer
|
||||
case 'e':
|
||||
// [Es]peranto
|
||||
if (b && b == 's') return SQMOD_VEHICLE_ESPERANTO;
|
||||
// [En]forcer
|
||||
else if (b && b == 'n') return SQMOD_VEHICLE_ENFORCER;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [F]aggio
|
||||
// [F]BI Rancher
|
||||
// [F]BI Washington
|
||||
// [F]iretruck
|
||||
// [F]latbed
|
||||
// [F]reeway
|
||||
case 'f':
|
||||
switch (b)
|
||||
{
|
||||
// [Fa]ggio
|
||||
case 'a': return SQMOD_VEHICLE_FAGGIO;
|
||||
// [FB]I Rancher
|
||||
// [FB]I Washington
|
||||
case 'b':
|
||||
// [FB]I [R]anche[r]
|
||||
if ((len > 2 && str[3] == 'r') || d == 'r') return SQMOD_VEHICLE_FBIRANCHER;
|
||||
// [FB]I [W]ashingto[n]
|
||||
else if ((len > 2 && str[3] == 'w') || (d == 'n' || d == 'w')) return SQMOD_VEHICLE_FBIWASHINGTON;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Fi]retruck
|
||||
case 'i': return SQMOD_VEHICLE_FIRETRUCK;
|
||||
// [Fl]atbed
|
||||
case 'l': return SQMOD_VEHICLE_FLATBED;
|
||||
// [Fr]eeway
|
||||
case 'r': return SQMOD_VEHICLE_FREEWAY;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [G]ang Burrito
|
||||
// [G]lendale
|
||||
// [G]reenwood
|
||||
case 'g':
|
||||
switch (b)
|
||||
{
|
||||
// [Ga]ng Burrito
|
||||
case 'a': return SQMOD_VEHICLE_GANGBURRITO;
|
||||
// [Gl]endale
|
||||
case 'l': return SQMOD_VEHICLE_GLENDALE;
|
||||
// [Gr]eenwood
|
||||
case 'r': return SQMOD_VEHICLE_GREENWOOD;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [H]elicopter
|
||||
// [H]ermes
|
||||
// [H]otring Racer (#1|A)(#2|B)(#3|C)
|
||||
// [H]unter
|
||||
case 'h':
|
||||
switch (b)
|
||||
{
|
||||
// [He]licopter
|
||||
// [He]rmes
|
||||
case 'e':
|
||||
// [Hel]icopter
|
||||
if (c == 'l') return SQMOD_VEHICLE_HELICOPTER;
|
||||
// [Her]mes
|
||||
else if (c == 'r') return SQMOD_VEHICLE_HERMES;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Ho]tring Racer (#1|A)(#2|B)(#3|C)
|
||||
case 'o':
|
||||
switch (d)
|
||||
{
|
||||
case '1':
|
||||
case 'a': return SQMOD_VEHICLE_HOTRINGRACER1;
|
||||
case '2':
|
||||
case 'b': return SQMOD_VEHICLE_HOTRINGRACER2;
|
||||
case '3':
|
||||
case 'c': return SQMOD_VEHICLE_HOTRINGRACER3;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [Hu]nter
|
||||
case 'u': return SQMOD_VEHICLE_HUNTER;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [I]daho
|
||||
// [I]nfernus
|
||||
case 'i':
|
||||
// [Id]aho
|
||||
if (b && b == 'd') return SQMOD_VEHICLE_IDAHO;
|
||||
// [In]fernus
|
||||
else if (b && b == 'n') return SQMOD_VEHICLE_INFERNUS;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [K]aufman Cab
|
||||
case 'k': return SQMOD_VEHICLE_KAUFMANCAB;
|
||||
// [L]andstalker
|
||||
// [L]inerunner
|
||||
// [L]ove Fist
|
||||
case 'l':
|
||||
switch (b)
|
||||
{
|
||||
// [La]ndstalker
|
||||
case 'a': return SQMOD_VEHICLE_LANDSTALKER;
|
||||
// [Li]nerunner
|
||||
case 'i': return SQMOD_VEHICLE_LINERUNNER;
|
||||
// [Lo]ve Fist
|
||||
case 'o': return SQMOD_VEHICLE_LOVEFIST;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
|
||||
}
|
||||
// [M]anana
|
||||
// [M]arquis
|
||||
// [M]averick
|
||||
// [M]esa Grande
|
||||
// [M]oonbeam
|
||||
// [M]r. Whoopee
|
||||
// [M]ule
|
||||
case 'm':
|
||||
switch (b)
|
||||
{
|
||||
// [Ma]nana
|
||||
// [Ma]rquis
|
||||
// [Ma]verick
|
||||
case 'a':
|
||||
// [Man]ana
|
||||
if (c == 'n') return SQMOD_VEHICLE_MANANA;
|
||||
// [Mar]quis
|
||||
else if (c == 'r') return SQMOD_VEHICLE_MARQUIS;
|
||||
// [Mav]erick
|
||||
else if (c == 'v') return SQMOD_VEHICLE_MAVERICK;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Me]sa Grande
|
||||
case 'e': return SQMOD_VEHICLE_MESAGRANDE;
|
||||
// [Mo]onbeam
|
||||
case 'o': return SQMOD_VEHICLE_MOONBEAM;
|
||||
// [Mr]. Whoopee
|
||||
case 'r': return SQMOD_VEHICLE_MRWHOOPEE;
|
||||
// [Mu]le
|
||||
case 'u': return SQMOD_VEHICLE_MULE;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [O]ceanic
|
||||
case 'o': return SQMOD_VEHICLE_OCEANIC;
|
||||
// [P]acker
|
||||
// [P]atriot
|
||||
// [P]CJ-600
|
||||
// [P]erennial
|
||||
// [P]hoenix
|
||||
// [P]izza Boy
|
||||
// [P]olice
|
||||
// [P]olice Maverick
|
||||
// [P]ony
|
||||
// [P]redator
|
||||
case 'p':
|
||||
switch (b)
|
||||
{
|
||||
// [Pa]cker
|
||||
// [Pa]triot
|
||||
case 'a':
|
||||
// [Pac]ker
|
||||
if (c == 'c') return SQMOD_VEHICLE_PACKER;
|
||||
// [Pat]riot
|
||||
else if (c == 't') return SQMOD_VEHICLE_PATRIOT;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [PC]J-600
|
||||
case 'c': return SQMOD_VEHICLE_PCJ600;
|
||||
// [Pe]rennial
|
||||
case 'e': return SQMOD_VEHICLE_PERENNIAL;
|
||||
// [Ph]oenix
|
||||
case 'h': return SQMOD_VEHICLE_PHOENIX;
|
||||
// [Pi]zza Boy
|
||||
case 'i':
|
||||
// [Po]lice
|
||||
// [Po]lice Maverick
|
||||
// [Po]ny
|
||||
case 'o':
|
||||
// [Po]lice
|
||||
if (d == 'e') return SQMOD_VEHICLE_POLICE;
|
||||
// [Po]lice Maverick
|
||||
else if ((len > 5 && str[6] == 'm') || (d == 'k' || d == 'm')) return SQMOD_VEHICLE_POLICEMAVERICK;
|
||||
// [Po]ny
|
||||
else if (c == 'n') return SQMOD_VEHICLE_PONY;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Pr]edator
|
||||
case 'r': return SQMOD_VEHICLE_PREDATOR;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [R]ancher
|
||||
// [R]C Bandit
|
||||
// [R]C Baron
|
||||
// [R]C Goblin
|
||||
// [R]C Raider
|
||||
// [R]eefer
|
||||
// [R]egina
|
||||
// [R]hino
|
||||
// [R]io
|
||||
// [R]omero's Hearse
|
||||
// [R]umpo
|
||||
case 'r':
|
||||
switch (b)
|
||||
{
|
||||
// [Ra]ncher
|
||||
case 'a': return SQMOD_VEHICLE_RANCHER;
|
||||
// [RC] Bandit
|
||||
// [RC] Baron
|
||||
// [RC] Goblin
|
||||
// [RC] Raider
|
||||
case 'c':
|
||||
// [RC] [B]andi[t]
|
||||
if (c == 'b' && d == 't') return SQMOD_VEHICLE_RCBANDIT;
|
||||
// [RC] [B]aro[n]
|
||||
else if (c == 'b' && d == 'n') return SQMOD_VEHICLE_RCBARON;
|
||||
// [RC] [G]oblin
|
||||
else if (c == 'g') return SQMOD_VEHICLE_RCGOBLIN;
|
||||
// [RC] [R]aide[r]
|
||||
else if (c == 'r' || d == 'r') return SQMOD_VEHICLE_RCRAIDER;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Re]efer
|
||||
// [Re]gina
|
||||
case 'e':
|
||||
// [Ree]fer
|
||||
if (c == 'e' || d == 'r') return SQMOD_VEHICLE_REEFER;
|
||||
// [Reg]ina
|
||||
else if (c == 'g' || d == 'a') return SQMOD_VEHICLE_REGINA;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Rh]ino
|
||||
case 'h': return SQMOD_VEHICLE_RHINO;
|
||||
// [Ri]o
|
||||
case 'i': return SQMOD_VEHICLE_RIO;
|
||||
// [Ro]mero's Hearse
|
||||
case 'o': return SQMOD_VEHICLE_HEARSE;
|
||||
// [Ru]mpo
|
||||
case 'u': return SQMOD_VEHICLE_RUMPO;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [S]abre
|
||||
// [S]abre Turbo
|
||||
// [S]anchez
|
||||
// [S]andking
|
||||
// [S]ea Sparrow
|
||||
// [S]ecuricar
|
||||
// [S]entinel
|
||||
// [S]entinel XS
|
||||
// [S]kimmer
|
||||
// [S]pand Express
|
||||
// [S]parrow
|
||||
// [S]peeder
|
||||
// [S]qualo
|
||||
// [S]tallion
|
||||
// [S]tinger
|
||||
// [S]tretch
|
||||
case 's':
|
||||
switch (b)
|
||||
{
|
||||
// [Sa]bre
|
||||
// [Sa]bre Turbo
|
||||
// [Sa]nchez
|
||||
// [Sa]ndking
|
||||
case 'a':
|
||||
// [Sab]r[e]
|
||||
if (c == 'b' && d == 'e') return SQMOD_VEHICLE_SABRE;
|
||||
// [Sab]re [T]urb[o]
|
||||
else if ((c == 'b' && d == 'o') || (len > 4 && str[5 ]== 't')) return SQMOD_VEHICLE_SABRETURBO;
|
||||
// [Sa]n[c]he[z]
|
||||
else if (d == 'c' || d == 'z') return SQMOD_VEHICLE_SANCHEZ;
|
||||
// [Sa]n[d]kin[g]
|
||||
else if (d == 'd' || d == 'g') return SQMOD_VEHICLE_SANDKING;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Se]a Sparrow
|
||||
// [Se]curicar
|
||||
// [Se]ntinel
|
||||
// [Se]ntinel XS
|
||||
case 'e':
|
||||
// [Sea] Sparro[w]
|
||||
if (c == 'e' || d == 'w') return SQMOD_VEHICLE_SEASPARROW;
|
||||
// [Sec]urica[r]
|
||||
else if (c == 'c' || d == 'r') return SQMOD_VEHICLE_SECURICAR;
|
||||
// [Sen]tine[l]
|
||||
else if (c == 'n' && d == 'l') return SQMOD_VEHICLE_SENTINEL;
|
||||
// [Sen]tinel X[S]
|
||||
else if (c == 'n' && d == 's') return SQMOD_VEHICLE_SENTINELXS;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Sk]immer
|
||||
case 'k': return SQMOD_VEHICLE_SKIMMER;
|
||||
// [Sp]and Express
|
||||
// [Sp]arrow
|
||||
// [Sp]eeder
|
||||
case 'p':
|
||||
// [Spa]nd [E]xpres[s]
|
||||
if (c == 'a' || ((len > 4 && str[5] == 'e') || d == 's')) return SQMOD_VEHICLE_SPANDEXPRESS;
|
||||
// [Spa]rro[w]
|
||||
else if (d == 'w' && (c == 'a' && d == 'w')) return SQMOD_VEHICLE_SPARROW;
|
||||
// [Spe]ede[r]
|
||||
else if (c == 'e' || d == 'r') return SQMOD_VEHICLE_SPEEDER;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Sq]ualo
|
||||
case 'q': return SQMOD_VEHICLE_SQUALO;
|
||||
// [St]allion
|
||||
// [St]inger
|
||||
// [St]retch
|
||||
case 't':
|
||||
// [Sta]llion
|
||||
if (c == 'a') return SQMOD_VEHICLE_STALLION;
|
||||
// [Sti]nger
|
||||
if (c == 'i') return SQMOD_VEHICLE_STINGER;
|
||||
// [Str]etch
|
||||
if (c == 'r') return SQMOD_VEHICLE_STRETCH;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [T]axi
|
||||
// [T]op Fun
|
||||
// [T]rashmaster
|
||||
// [T]ropic
|
||||
case 't':
|
||||
switch (b)
|
||||
{
|
||||
// [Ta]xi
|
||||
case 'a': return SQMOD_VEHICLE_TAXI;
|
||||
// [To]p Fun
|
||||
case 'o': return SQMOD_VEHICLE_TOPFUN;
|
||||
// [Tr]ashmaster
|
||||
// [Tr]opic
|
||||
case 'r':
|
||||
// [Tr]ashmaster
|
||||
if (c == 'a') return SQMOD_VEHICLE_TRASHMASTER;
|
||||
// [Tr]opic
|
||||
if (c == 'o') return SQMOD_VEHICLE_TROPIC;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [V]CN Maverick
|
||||
// [V]ice Squad Cheetah
|
||||
// [V]irgo
|
||||
// [V]oodoo
|
||||
case 'v':
|
||||
switch (b)
|
||||
{
|
||||
// [VC]N Maverick
|
||||
case 'c': return SQMOD_VEHICLE_VCNMAVERICK;
|
||||
// [Vi]ce Squad Cheetah
|
||||
// [Vi]rgo
|
||||
case 'i':
|
||||
// [Vic]e Squad Cheetah
|
||||
if (c == 'a') return SQMOD_VEHICLE_VICECHEE;
|
||||
// [Vir]go
|
||||
if (c == 'o') return SQMOD_VEHICLE_VIRGO;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Vo]odoo
|
||||
case 'o': return SQMOD_VEHICLE_VOODOO;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
// [W]alton
|
||||
// [W]ashington
|
||||
case 'w':
|
||||
// [Wa]lton
|
||||
if (b == 'a' && c == 'l') return SQMOD_VEHICLE_WALTON;
|
||||
// [Wa]shington
|
||||
else if (b == 'a' && c == 's') return SQMOD_VEHICLE_WASHINGTON;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [Y]ankee
|
||||
case 'y': return SQMOD_VEHICLE_YANKEE;
|
||||
// [Z]ebra Cab
|
||||
case 'z': return SQMOD_VEHICLE_ZEBRACAB;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsAutomobileValid(Int32 id)
|
||||
{
|
||||
return (strlen(GetAutomobileName(id)) > 0);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool IsModelActuallyWeapon(Int32 id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 259:
|
||||
case 260:
|
||||
case 261:
|
||||
case 262:
|
||||
case 263:
|
||||
case 264:
|
||||
case 265:
|
||||
case 266:
|
||||
case 267:
|
||||
case 268:
|
||||
case 269:
|
||||
case 270:
|
||||
case 271:
|
||||
case 272:
|
||||
case 274:
|
||||
case 275:
|
||||
case 276:
|
||||
case 277:
|
||||
case 278:
|
||||
case 279:
|
||||
case 280:
|
||||
case 281:
|
||||
case 282:
|
||||
case 283:
|
||||
case 284:
|
||||
case 285:
|
||||
case 286:
|
||||
case 287:
|
||||
case 288:
|
||||
case 289:
|
||||
case 290:
|
||||
case 291: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,14 +1,18 @@
|
||||
#ifndef _MISC_CONSTANTS_HPP_
|
||||
#define _MISC_CONSTANTS_HPP_
|
||||
#ifndef _MISC_VEHICLE_HPP_
|
||||
#define _MISC_VEHICLE_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetAutomobileName(Uint32 id);
|
||||
void SetAutomobileName(Uint32 id, CCStr name);
|
||||
Int32 GetAutomobileID(CCStr name);
|
||||
bool IsAutomobileValid(Int32 id);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_CONSTANTS_HPP_
|
||||
#endif // _MISC_VEHICLE_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/VehicleImmunity.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CVehicleImmunity(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,136 +0,0 @@
|
||||
#ifndef _MISC_VEHICLE_IMMUNITY_HPP_
|
||||
#define _MISC_VEHICLE_IMMUNITY_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
struct CVehicleImmunity
|
||||
{
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity(const CVehicleImmunity & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity(CVehicleImmunity && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CVehicleImmunity();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity & operator= (const CVehicleImmunity & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity & operator= (CVehicleImmunity && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator == (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator != (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator < (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator > (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator <= (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator >= (const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CVehicleImmunity & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator SQInt32 () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
operator bool () const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 GetFlags() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void SetFlags(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CVehicleImmunity & SetnGet(SQInt32 flags);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Apply(const CVehicle & vehicle) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void EnableAll();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void DisableAll();
|
||||
|
||||
protected:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInt32 m_Flags;
|
||||
};
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_VEHICLE_IMMUNITY_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/WastedSettings.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CWastedSettings(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,115 +0,0 @@
|
||||
#ifndef _MISC_WASTED_SETTINGS_HPP_
|
||||
#define _MISC_WASTED_SETTINGS_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "Base/Color3.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
struct CWastedSettings
|
||||
{
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
typedef SQUnsignedInteger32 U32;
|
||||
typedef SQFloat F32;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
U32 DeathTimer, FadeTimer;
|
||||
F32 FadeInSpeed, FadeOutSpeed;
|
||||
Color3 FadeColor;
|
||||
U32 CorpseFadeStart, CorpseFadeTime;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings(U32 dt, U32 ft, F32 fis, F32 fos, const Color3 & fc, U32 cfs, U32 cft);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings(const CWastedSettings & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings(CWastedSettings && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CWastedSettings();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings & operator= (const CWastedSettings & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings & operator= (CWastedSettings && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings operator+ (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings operator- (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings operator* (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWastedSettings operator/ (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator== (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator!= (const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CWastedSettings & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Set() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Get() const;
|
||||
};
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_WASTED_SETTINGS_HPP_
|
@@ -1,383 +1,319 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/Weapon.hpp"
|
||||
#include "Entity.hpp"
|
||||
#include "Register.hpp"
|
||||
#include "Core.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const CWeapon CWeapon::NIL = CWeapon();
|
||||
static String CS_Weapon_Names[] = {
|
||||
"Unarmed", "Brass Knuckles", "Screwdriver", "Golf Club",
|
||||
"Nightstick", "Knife", "Baseball Bat", "Hammer",
|
||||
"Meat Cleaver", "Machete", "Katana", "Chainsaw",
|
||||
"Grenade", "Remote Detonation Grenade", "Tear Gas", "Molotov Cocktails",
|
||||
"Rocket", "Colt .45", "Python", "Pump-Action Shotgun",
|
||||
"SPAS-12 Shotgun", "Stubby Shotgun", "TEC-9", "Uzi",
|
||||
"Silenced Ingram", "MP5", "M4", "Ruger",
|
||||
"Sniper Rifle", "Laserscope Sniper Rifle", "Rocket Launcher", "Flamethrower",
|
||||
"M60", "Minigun", "Bomb", "Helicannon",
|
||||
"Camera", "", "", "Vehicle",
|
||||
"", "Explosion", "Driveby", "Drowned",
|
||||
"Fall", "", "", "",
|
||||
"", "", "", "Explosion",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "", "",
|
||||
"", "", "Suicide", ""
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon::CWeapon()
|
||||
: m_ID(SQMOD_UNKNOWN), m_Ammo(0)
|
||||
CCStr GetWeaponName(Uint32 id)
|
||||
{
|
||||
|
||||
return (id > 70) ? _SC("") : CS_Weapon_Names[id].c_str();
|
||||
}
|
||||
|
||||
CWeapon::CWeapon(SQInt32 id)
|
||||
: CWeapon(id, 0)
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWeaponName(Uint32 id, CCStr name)
|
||||
{
|
||||
|
||||
if (id <= 70)
|
||||
CS_Weapon_Names[id].assign(name);
|
||||
}
|
||||
|
||||
CWeapon::CWeapon(SQInt32 id, SQInt32 ammo)
|
||||
: m_ID(VALID_ENTITYGETEX(id, Max)), m_Ammo(ammo)
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Int32 GetWeaponID(CCStr name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CWeapon::CWeapon(const SQChar * name, SQInt32 id, SQInt32 ammo)
|
||||
: m_ID(GetWeaponID(name)), m_Ammo(ammo)
|
||||
{
|
||||
if (VALID_ENTITYEX(m_ID, Max))
|
||||
// Clone the string into an editable version
|
||||
String str(name);
|
||||
// Strip non alphanumeric characters from the name
|
||||
str.erase(std::remove_if(str.begin(), str.end(), std::not1(std::ptr_fun(::isalnum))), str.end());
|
||||
// Convert the string to lowercase
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
// See if we still have a valid name after the cleanup
|
||||
if(str.length() < 1)
|
||||
return SQMOD_UNKNOWN;
|
||||
// Grab the actual length of the string
|
||||
Uint32 len = static_cast< Uint32 >(str.length());
|
||||
// Get the most significant characters used to identify a weapon
|
||||
CharT a = str[0], b = 0, c = 0, d = str[len-1];
|
||||
// Look for deeper specifiers
|
||||
if(str.length() >= 3)
|
||||
{
|
||||
m_ID = id;
|
||||
c = str[2];
|
||||
b = str[1];
|
||||
}
|
||||
else if(str.length() >= 2)
|
||||
b = str[1];
|
||||
// Search for a pattern in the name
|
||||
switch(a)
|
||||
{
|
||||
// [B]aseball Bat
|
||||
// [B]omb
|
||||
// [B]rass Knuckles
|
||||
case 'b':
|
||||
// [Ba]seball Bat
|
||||
if (b == 'a') return SQMOD_WEAPON_BASEBALLBAT;
|
||||
// [Bo]mb
|
||||
else if (b == 'o') return SQMOD_WEAPON_BOMB;
|
||||
// [Br]ass Knuckles
|
||||
else if (b == 'r') return SQMOD_WEAPON_BRASSKNUCKLES;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [C]amera
|
||||
// [C]hainsaw
|
||||
// [C]olt .45
|
||||
case 'c':
|
||||
// [Ca]mera
|
||||
if (b == 'a') return SQMOD_WEAPON_CAMERA;
|
||||
// [Ch]ainsaw
|
||||
else if (b == 'h') return SQMOD_WEAPON_CHAINSAW;
|
||||
// [Co]lt .45
|
||||
else if (b == 'o') return SQMOD_WEAPON_COLT45;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [D]riveby
|
||||
// [D]rowned
|
||||
case 'd':
|
||||
// [Dr]iveby
|
||||
if (b == 'r' && (c == 'i' || d == 'y')) return SQMOD_WEAPON_DRIVEBY;
|
||||
// [Dr]owned
|
||||
else if (b == 'r' && (c == 'o' || d == 'd')) return SQMOD_WEAPON_DROWNED;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [E]xplosion
|
||||
case 'e': return SQMOD_WEAPON_EXPLOSION2;
|
||||
// [F]all
|
||||
// [F]lamethrower
|
||||
case 'f':
|
||||
// [Fa]ll
|
||||
if (b == 'a') return SQMOD_WEAPON_FALL;
|
||||
// [Fl]amethrower
|
||||
else if (b == 'l') return SQMOD_WEAPON_FLAMETHROWER;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [G]olf Club
|
||||
// [G]renade
|
||||
case 'g':
|
||||
// [Go]lf Club
|
||||
if (b == 'o') return SQMOD_WEAPON_GOLFCLUB;
|
||||
// [Gr]enade
|
||||
else if (b == 'r') return SQMOD_WEAPON_GRENADE;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [H]ammer
|
||||
// [H]elicannon
|
||||
case 'h':
|
||||
// [Ha]mmer
|
||||
if (b == 'a') return SQMOD_WEAPON_HAMMER;
|
||||
// [He]licannon
|
||||
else if (b == 'e') return SQMOD_WEAPON_HELICANNON;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [K]atana
|
||||
// [K]nife
|
||||
case 'k':
|
||||
// [Ka]tana
|
||||
if (b == 'a') return SQMOD_WEAPON_KATANA;
|
||||
// [Kn]ife
|
||||
else if (b == 'n') return SQMOD_WEAPON_KNIFE;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [L]aserscope Sniper Rifle
|
||||
case 'l': return SQMOD_WEAPON_LASERSCOPE;
|
||||
// [M]4
|
||||
// [M]60
|
||||
// [M]achete
|
||||
// [M]eat Cleaver
|
||||
// [M]inigun
|
||||
// [M]olotov Cocktails
|
||||
// [M]P5
|
||||
case 'm':
|
||||
// [M4]
|
||||
if (b == '4') return SQMOD_WEAPON_M4;
|
||||
// [M6]0
|
||||
else if (b == '6') return SQMOD_WEAPON_M60;
|
||||
// [Ma]chete
|
||||
else if (b == 'a') return SQMOD_WEAPON_MACHETE;
|
||||
// [Me]at Cleaver
|
||||
else if (b == 'e') return SQMOD_WEAPON_MEATCLEAVER;
|
||||
// [Mi]nigun
|
||||
else if (b == 'i') return SQMOD_WEAPON_MINIGUN;
|
||||
// [Mo]lotov Cocktails
|
||||
else if (b == 'o') return SQMOD_WEAPON_MOLOTOV;
|
||||
// [MP]5
|
||||
else if (b == 'p') return SQMOD_WEAPON_MP5;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [N]ightstick
|
||||
case 'n': return SQMOD_WEAPON_NIGHTSTICK;
|
||||
// [P]ump-Action Shotgun
|
||||
// [P]ython
|
||||
case 'p':
|
||||
// [Pu]mp-Action Shotgun
|
||||
if (b == 'u') return SQMOD_WEAPON_SHOTGUN;
|
||||
// [Py]thon
|
||||
else if (b == 'y') return SQMOD_WEAPON_PYTHON;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [R]emote Detonation Grenade
|
||||
// [R]ocket
|
||||
// [R]ocket Launcher
|
||||
// [R]uger
|
||||
case 'r':
|
||||
// [Re]mote Detonation Grenade
|
||||
if (b == 'e') return SQMOD_WEAPON_REMOTE;
|
||||
// [Ro]cke[t]
|
||||
else if (b == 'o' && d == 't') return SQMOD_WEAPON_ROCKET;
|
||||
// [Ro]cket [L]aunche[r]
|
||||
else if (b == 'o' && (d == 'r' || d == 'l' || (len > 5 && str[6] == 'l'))) return SQMOD_WEAPON_ROCKETLAUNCHER;
|
||||
// [Ru]ger
|
||||
else if (b == 'u') return SQMOD_WEAPON_RUGER;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [S]crewdriver
|
||||
// [S]ilenced Ingram
|
||||
// [S]niper Rifle
|
||||
// [S]PAS-12 Shotgun
|
||||
// [S]tubby Shotgun
|
||||
// [S]uicide
|
||||
case 's':
|
||||
// [Sc]rewdriver
|
||||
if (b == 'c') return SQMOD_WEAPON_SCREWDRIVER;
|
||||
// [Si]lenced Ingram
|
||||
else if (b == 'i') return SQMOD_WEAPON_INGRAM;
|
||||
// [Sn]iper Rifle
|
||||
else if (b == 'n') return SQMOD_WEAPON_SNIPER;
|
||||
// [SP]AS-12 Shotgun
|
||||
else if (b == 'p') return SQMOD_WEAPON_SPAS12;
|
||||
// [St]ubby Shotgun
|
||||
else if (b == 't') return SQMOD_WEAPON_STUBBY;
|
||||
// [Su]icide
|
||||
else if (b == 'u') return SQMOD_WEAPON_SUICIDE;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [T]ear Gas
|
||||
// [T]EC-9
|
||||
case 't':
|
||||
// [Tea]r Ga[s]
|
||||
if (b == 'e' && (c == 'a' || d == 's')) return SQMOD_WEAPON_TEARGAS;
|
||||
// [TEC]-[9]
|
||||
else if (b == 'e' && (c == 'c' || d == '9')) return SQMOD_WEAPON_TEC9;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [U]narmed
|
||||
// [U]zi
|
||||
case 'u':
|
||||
// [Un]armed
|
||||
if (b == 'n') return SQMOD_WEAPON_UNARMED;
|
||||
// [Uz]i
|
||||
else if (b == 'z') return SQMOD_WEAPON_UZI;
|
||||
// Default to unknwon
|
||||
else return SQMOD_UNKNOWN;
|
||||
// [V]ehicle
|
||||
case 'v': return SQMOD_WEAPON_VEHICLE;
|
||||
// Default to unknwon
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon::CWeapon(const CWeapon & w)
|
||||
: m_ID(w.m_ID)
|
||||
, m_Ammo(w.m_Ammo)
|
||||
, m_Tag(w.m_Tag)
|
||||
, m_Data(w.m_Data)
|
||||
bool IsWeaponValid(Int32 id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CWeapon::CWeapon(CWeapon && w)
|
||||
: m_ID(w.m_ID)
|
||||
, m_Ammo(w.m_Ammo)
|
||||
, m_Tag(w.m_Tag)
|
||||
, m_Data(w.m_Data)
|
||||
{
|
||||
|
||||
return (strlen(GetWeaponName(id)) > 0);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon::~CWeapon()
|
||||
bool IsWeaponNatural(Int32 id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon & CWeapon::operator = (const CWeapon & w)
|
||||
{
|
||||
m_ID = w.m_ID;
|
||||
m_Ammo = w.m_Ammo;
|
||||
m_Tag = w.m_Tag;
|
||||
m_Data = w.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CWeapon & CWeapon::operator = (CWeapon && w)
|
||||
{
|
||||
m_ID = w.m_ID;
|
||||
m_Ammo = w.m_Ammo;
|
||||
m_Tag = w.m_Tag;
|
||||
m_Data = w.m_Data;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon & CWeapon::operator = (SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CWeapon::operator == (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID == w.m_ID);
|
||||
}
|
||||
|
||||
bool CWeapon::operator != (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID != w.m_ID);
|
||||
}
|
||||
|
||||
bool CWeapon::operator < (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID < w.m_ID);
|
||||
}
|
||||
|
||||
bool CWeapon::operator > (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID < w.m_ID);
|
||||
}
|
||||
|
||||
bool CWeapon::operator <= (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID <= w.m_ID);
|
||||
}
|
||||
|
||||
bool CWeapon::operator >= (const CWeapon & w) const
|
||||
{
|
||||
return (m_ID >= w.m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CWeapon::Cmp(const CWeapon & w) const
|
||||
{
|
||||
if (m_ID == w.m_ID)
|
||||
switch (id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (m_ID > w.m_ID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
case SQMOD_WEAPON_VEHICLE:
|
||||
case SQMOD_WEAPON_DRIVEBY:
|
||||
case SQMOD_WEAPON_DROWNED:
|
||||
case SQMOD_WEAPON_FALL:
|
||||
case SQMOD_WEAPON_EXPLOSION2:
|
||||
case SQMOD_WEAPON_SUICIDE: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CWeapon::ToString() const
|
||||
Int32 WeaponToModel(Int32 id)
|
||||
{
|
||||
return GetWeaponName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CWeapon::GetID() const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
void CWeapon::SetID(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CWeapon & CWeapon::SetnGet(SQInt32 id)
|
||||
{
|
||||
m_ID = VALID_ENTITYGETEX(id, Max);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CWeapon::GetGlobalTag() const
|
||||
{
|
||||
return GlobalTag(m_ID);
|
||||
}
|
||||
|
||||
void CWeapon::SetGlobalTag(const SQChar * tag) const
|
||||
{
|
||||
GlobalTag(m_ID, tag);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CWeapon::GetGlobalData() const
|
||||
{
|
||||
return GlobalData(m_ID);
|
||||
}
|
||||
|
||||
void CWeapon::SetGlobalData(SqObj & data) const
|
||||
{
|
||||
GlobalData(m_ID, data);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CWeapon::GetLocalTag() const
|
||||
{
|
||||
return m_Tag.c_str();
|
||||
}
|
||||
|
||||
void CWeapon::SetLocalTag(const SQChar * tag)
|
||||
{
|
||||
m_Tag = tag;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SqObj & CWeapon::GetLocalData()
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
|
||||
void CWeapon::SetLocalData(SqObj & data)
|
||||
{
|
||||
m_Data = data;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CWeapon::IsValid() const
|
||||
{
|
||||
return (VALID_ENTITYEX(m_ID, Max));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
const SQChar * CWeapon::GetName() const
|
||||
{
|
||||
return GetWeaponName(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CWeapon::SetName(const SQChar * name)
|
||||
{
|
||||
m_ID = GetWeaponID(name);
|
||||
m_ID = VALID_ENTITYGETEX(m_ID, Max);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CWeapon::GetAmmo() const
|
||||
{
|
||||
return m_Ammo;
|
||||
}
|
||||
|
||||
void CWeapon::SetAmmo(SQInt32 amount)
|
||||
{
|
||||
m_Ammo = amount;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CWeapon::IsNatural() const
|
||||
{
|
||||
return IsWeaponNatural(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQFloat CWeapon::GetDataValue(SQInt32 field) const
|
||||
{
|
||||
return _Func->GetWeaponDataValue(m_ID, field);
|
||||
}
|
||||
|
||||
void CWeapon::SetDataValue(SQInt32 field, SQFloat value) const
|
||||
{
|
||||
_Func->SetWeaponDataValue(m_ID, field, value);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CWeapon::ResetData() const
|
||||
{
|
||||
_Func->ResetWeaponData(m_ID);
|
||||
}
|
||||
|
||||
void CWeapon::ResetData(SQInt32 field) const
|
||||
{
|
||||
_Func->ResetWeaponDataValue(m_ID, field);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CWeapon::IsDataModified(SQInt32 field) const
|
||||
{
|
||||
return _Func->IsWeaponDataValueModified(m_ID, field);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CWeapon::SetOn(const Reference< CPlayer > & player) const
|
||||
{
|
||||
if (*this && player)
|
||||
switch (id)
|
||||
{
|
||||
_Func->SetPlayerWeapon(player, m_ID, m_Ammo);
|
||||
}
|
||||
else if (!player)
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player weapon> using an invalid argument: %d"), _SCI32(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player weapon> using an invalid instance: %d"), m_ID);
|
||||
case SQMOD_WEAPON_UNARMED: return 293;
|
||||
case SQMOD_WEAPON_BRASSKNUCKLES: return 259;
|
||||
case SQMOD_WEAPON_SCREWDRIVER: return 260;
|
||||
case SQMOD_WEAPON_GOLFCLUB: return 261;
|
||||
case SQMOD_WEAPON_NIGHTSTICK: return 262;
|
||||
case SQMOD_WEAPON_KNIFE: return 263;
|
||||
case SQMOD_WEAPON_BASEBALLBAT: return 264;
|
||||
case SQMOD_WEAPON_HAMMER: return 265;
|
||||
case SQMOD_WEAPON_MEATCLEAVER: return 266;
|
||||
case SQMOD_WEAPON_MACHETE: return 267;
|
||||
case SQMOD_WEAPON_KATANA: return 268;
|
||||
case SQMOD_WEAPON_CHAINSAW: return 269;
|
||||
case SQMOD_WEAPON_GRENADE: return 270;
|
||||
case SQMOD_WEAPON_REMOTE: return 291;
|
||||
case SQMOD_WEAPON_TEARGAS: return 271;
|
||||
case SQMOD_WEAPON_MOLOTOV: return 272;
|
||||
case SQMOD_WEAPON_ROCKET: return 273;
|
||||
case SQMOD_WEAPON_COLT45: return 274;
|
||||
case SQMOD_WEAPON_PYTHON: return 275;
|
||||
case SQMOD_WEAPON_SHOTGUN: return 277;
|
||||
case SQMOD_WEAPON_SPAS12: return 278;
|
||||
case SQMOD_WEAPON_STUBBY: return 279;
|
||||
case SQMOD_WEAPON_TEC9: return 281;
|
||||
case SQMOD_WEAPON_UZI: return 282;
|
||||
case SQMOD_WEAPON_INGRAM: return 283;
|
||||
case SQMOD_WEAPON_MP5: return 284;
|
||||
case SQMOD_WEAPON_M4: return 280;
|
||||
case SQMOD_WEAPON_RUGER: return 276;
|
||||
case SQMOD_WEAPON_SNIPER: return 285;
|
||||
case SQMOD_WEAPON_LASERSCOPE: return 286;
|
||||
case SQMOD_WEAPON_ROCKETLAUNCHER: return 287;
|
||||
case SQMOD_WEAPON_FLAMETHROWER: return 288;
|
||||
case SQMOD_WEAPON_M60: return 289;
|
||||
case SQMOD_WEAPON_MINIGUN: return 290;
|
||||
case SQMOD_WEAPON_BOMB: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_HELICANNON: return 294;
|
||||
case SQMOD_WEAPON_CAMERA: return 292;
|
||||
case SQMOD_WEAPON_VEHICLE: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_EXPLOSION1: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_DRIVEBY: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_DROWNED: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_FALL: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_EXPLOSION2: return SQMOD_UNKNOWN;
|
||||
case SQMOD_WEAPON_SUICIDE: return SQMOD_UNKNOWN;
|
||||
default: return SQMOD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
void CWeapon::GiveTo(const Reference< CPlayer > & player) const
|
||||
{
|
||||
if (*this && player)
|
||||
{
|
||||
_Func->GivePlayerWeapon(player, m_ID, m_Ammo);
|
||||
}
|
||||
else if (!player)
|
||||
{
|
||||
LogErr(_SC("Attempting to <give player weapon> using an invalid argument: %d"), _SCI32(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr(_SC("Attempting to <give player weapon> using an invalid instance: %d"), m_ID);
|
||||
}
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
void CWeapon::SetOn(const Reference< CPlayer > & player, SQInt32 ammo) const
|
||||
{
|
||||
if (*this && player)
|
||||
{
|
||||
_Func->SetPlayerWeapon(player, m_ID, ammo);
|
||||
}
|
||||
else if (!player)
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player weapon> using an invalid argument: %d"), _SCI32(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr(_SC("Attempting to <set player weapon> using an invalid instance: %d"), m_ID);
|
||||
}
|
||||
}
|
||||
|
||||
void CWeapon::GiveTo(const Reference< CPlayer > & player, SQInt32 ammo) const
|
||||
{
|
||||
if (*this && player)
|
||||
{
|
||||
_Func->GivePlayerWeapon(player, m_ID, ammo);
|
||||
}
|
||||
else if (!player)
|
||||
{
|
||||
LogErr(_SC("Attempting to <give player weapon> using an invalid argument: %d"), _SCI32(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
LogErr(_SC("Attempting to <give player weapon> using an invalid instance: %d"), m_ID);
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Register_CWeapon(HSQUIRRELVM vm)
|
||||
{
|
||||
// Output debugging information
|
||||
LogDbg("Beginning registration of <CWeapon> type");
|
||||
// Attempt to register the specified type
|
||||
Sqrat::RootTable(vm).Bind(_SC("CWeapon"), Sqrat::Class< CWeapon >(vm, _SC("CWeapon"))
|
||||
/* Constructors */
|
||||
.Ctor()
|
||||
.Ctor< SQInt32 >()
|
||||
.Ctor< SQInt32, SQInt32 >()
|
||||
.Ctor< const SQChar *, SQInt32, SQInt32 >()
|
||||
/* Metamethods */
|
||||
.Func(_SC("_cmp"), &CWeapon::Cmp)
|
||||
/* Properties */
|
||||
.Prop(_SC("id"), &CWeapon::GetID, &CWeapon::SetID)
|
||||
.Prop(_SC("gtag"), &CWeapon::GetGlobalTag, &CWeapon::SetGlobalTag)
|
||||
.Prop(_SC("gdata"), &CWeapon::GetGlobalData, &CWeapon::SetGlobalData)
|
||||
.Prop(_SC("ltag"), &CWeapon::GetLocalTag, &CWeapon::SetLocalTag)
|
||||
.Prop(_SC("ldata"), &CWeapon::GetLocalData, &CWeapon::SetLocalData)
|
||||
.Prop(_SC("name"), &CWeapon::GetName, &CWeapon::SetName)
|
||||
.Prop(_SC("valid"), &CWeapon::IsValid)
|
||||
.Prop(_SC("ammo"), &CWeapon::GetAmmo, &CWeapon::SetAmmo)
|
||||
.Prop(_SC("natural"), &CWeapon::IsNatural)
|
||||
/* Functions */
|
||||
.Func(_SC("setng"), &CWeapon::SetnGet)
|
||||
.Func(_SC("get_value"), &CWeapon::GetDataValue)
|
||||
.Func(_SC("set_value"), &CWeapon::SetDataValue)
|
||||
.Func(_SC("is_modified"), &CWeapon::IsDataModified)
|
||||
/* Overloads */
|
||||
.Overload< void (CWeapon::*)(void) const >(_SC("reset_data"), &CWeapon::ResetData)
|
||||
.Overload< void (CWeapon::*)(SQInt32) const >(_SC("reset_data"), &CWeapon::ResetData)
|
||||
.Overload< void (CWeapon::*)(const Reference< CPlayer > &) const >(_SC("set_on"), &CWeapon::SetOn)
|
||||
.Overload< void (CWeapon::*)(const Reference< CPlayer > &, SQInt32) const >(_SC("set_on"), &CWeapon::SetOn)
|
||||
.Overload< void (CWeapon::*)(const Reference< CPlayer > &) const >(_SC("give_to"), &CWeapon::GiveTo)
|
||||
.Overload< void (CWeapon::*)(const Reference< CPlayer > &, SQInt32) const >(_SC("give_to"), &CWeapon::GiveTo)
|
||||
);
|
||||
// Output debugging information
|
||||
LogDbg("Registration of <CWeapon> type was successful");
|
||||
// Registration succeeded
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@@ -2,299 +2,17 @@
|
||||
#define _MISC_WEAPON_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Shared.hpp"
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* Class responsible for managing and interacting with weapon models.
|
||||
*/
|
||||
class CWeapon : public IdentifierStorage< CWeapon, SQMOD_WEAPONID_CAP >
|
||||
{
|
||||
public:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Helper member for times when a null reference to an instance of this type is needed.
|
||||
*/
|
||||
static const CWeapon NIL;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Default constructor.
|
||||
*/
|
||||
CWeapon();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model specified.
|
||||
*/
|
||||
CWeapon(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model specified.
|
||||
*/
|
||||
CWeapon(SQInt32 id, SQInt32 ammo);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Construct an instance of this type and reference the model extracted from the specified name.
|
||||
*/
|
||||
CWeapon(const SQChar * name, SQInt32 id, SQInt32 ammo);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy constructor.
|
||||
*/
|
||||
CWeapon(const CWeapon & w);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move constructor.
|
||||
*/
|
||||
CWeapon(CWeapon && w);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*/
|
||||
~CWeapon();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copy assignment operator.
|
||||
*/
|
||||
CWeapon & operator = (const CWeapon & w);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Move assignment operator.
|
||||
*/
|
||||
CWeapon & operator = (CWeapon && w);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Model identifier assignment operator.
|
||||
*/
|
||||
CWeapon & operator = (SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Equality comparison operator.
|
||||
*/
|
||||
bool operator == (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Inequality comparison operator.
|
||||
*/
|
||||
bool operator != (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than comparison operator.
|
||||
*/
|
||||
bool operator < (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than comparison operator.
|
||||
*/
|
||||
bool operator > (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Less than or equal comparison operator.
|
||||
*/
|
||||
bool operator <= (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Greater than or equal comparison operator.
|
||||
*/
|
||||
bool operator >= (const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to weapon identifier.
|
||||
*/
|
||||
operator SQInt32 () const
|
||||
{
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to weapon identifier.
|
||||
*/
|
||||
operator Int64 () const
|
||||
{
|
||||
return _SCI64(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Implicit conversion to boolean.
|
||||
*/
|
||||
operator bool () const
|
||||
{
|
||||
return IsWeaponValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Negation operator.
|
||||
*/
|
||||
bool operator ! () const
|
||||
{
|
||||
return !IsWeaponValid(m_ID);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script to compare two instances of this type.
|
||||
*/
|
||||
SQInteger Cmp(const CWeapon & w) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Convert this type to a string.
|
||||
*/
|
||||
const SQChar * ToString() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier referenced by this instance.
|
||||
*/
|
||||
SQInteger GetID() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier referenced by this instance.
|
||||
*/
|
||||
void SetID(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the identifier that this insance should reference and
|
||||
* get a reference to the instance to chain operations.
|
||||
*/
|
||||
CWeapon & SetnGet(SQInt32 id);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global tag.
|
||||
*/
|
||||
const SQChar * GetGlobalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global tag.
|
||||
*/
|
||||
void SetGlobalTag(const SQChar * tag) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the global data.
|
||||
*/
|
||||
SqObj & GetGlobalData() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the global data.
|
||||
*/
|
||||
void SetGlobalData(SqObj & data) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local tag.
|
||||
*/
|
||||
const SQChar * GetLocalTag() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local tag.
|
||||
*/
|
||||
void SetLocalTag(const SQChar * tag);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the local data.
|
||||
*/
|
||||
SqObj & GetLocalData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the local data.
|
||||
*/
|
||||
void SetLocalData(SqObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the referenced model identifier is valid.
|
||||
*/
|
||||
bool IsValid() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the name of the referenced model.
|
||||
*/
|
||||
const SQChar * GetName() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the identifier of the referenced model.
|
||||
*/
|
||||
void SetName(const SQChar * name);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the ammount of ammo associated with this instance.
|
||||
*/
|
||||
SQInteger GetAmmo() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the ammount of ammo associated with this instance.
|
||||
*/
|
||||
void SetAmmo(SQInt32 amount);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the referenced weapon identifier points to a weapon that may not be used by
|
||||
* another player to perform a kill. Such as a player fall, drown, explosion etc.
|
||||
*/
|
||||
bool IsNatural() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the value in the specified field from the weapon data.
|
||||
*/
|
||||
SQFloat GetDataValue(SQInt32 field) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Change the value in the specified field from the weapon data.
|
||||
*/
|
||||
void SetDataValue(SQInt32 field, SQFloat value) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Reset the data for the referenced weapon identifier.
|
||||
*/
|
||||
void ResetData() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Reset the foe;d data data for the referenced weapon identifier.
|
||||
*/
|
||||
void ResetData(SQInt32 field) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the data at the specified field was modified.
|
||||
*/
|
||||
bool IsDataModified(SQInt32 field) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the weapon of the specified player instance to the referenced weapon identifier.
|
||||
*/
|
||||
void SetOn(const Reference< CPlayer > & player) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Give the referenced weapon identifier to the specified player instance.
|
||||
*/
|
||||
void GiveTo(const Reference< CPlayer > & player) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the weapon of the specified player instance to the referenced weapon identifier.
|
||||
*/
|
||||
void SetOn(const Reference< CPlayer > & player, SQInt32 ammo) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Give the referenced weapon identifier to the specified player instance.
|
||||
*/
|
||||
void GiveTo(const Reference< CPlayer > & player, SQInt32 ammo) const;
|
||||
|
||||
private:
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The identifier of the referenced model.
|
||||
*/
|
||||
SQInt32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The ammo associated with this instance.
|
||||
*/
|
||||
SQInt32 m_Ammo;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local tag associated with this instance
|
||||
*/
|
||||
SqTag m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* The local data associated with this instance.
|
||||
*/
|
||||
SqObj m_Data;
|
||||
};
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCStr GetWeaponName(Uint32 id);
|
||||
void SetWeaponName(Uint32 id, CCStr name);
|
||||
Int32 GetWeaponID(CCStr name);
|
||||
bool IsWeaponValid(Int32 id);
|
||||
Int32 WeaponToModel(Int32 id);
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
|
230
source/Misc/World.cpp
Normal file
230
source/Misc/World.cpp
Normal file
@@ -0,0 +1,230 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Misc/World.hpp"
|
||||
#include "Base/Color3.hpp"
|
||||
#include "Base/Vector2.hpp"
|
||||
#include "Base/Vector3.hpp"
|
||||
#include "Entity/Player.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetTimeRate(Uint32 rate) { _Func->SetTimeRate(rate); }
|
||||
Uint32 GetTimeRate(void) { return _Func->GetTimeRate(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetHour(Int32 hour) { _Func->SetHour(hour); }
|
||||
Int32 GetHour(void) { return _Func->GetHour(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMinute(Int32 minute) { _Func->SetMinute(minute); }
|
||||
Int32 GetMinute(void) { return _Func->GetMinute(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWeather(Int32 weather) { _Func->SetWeather(weather); }
|
||||
Int32 GetWeather(void) { return _Func->GetWeather(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGravity(Float32 gravity) { _Func->SetGamespeed(gravity); }
|
||||
Float32 GetGravity(void) { return _Func->GetGamespeed(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGamespeed(Float32 speed) { _Func->SetGamespeed(speed); }
|
||||
Float32 GetGamespeed(void) { return _Func->GetGamespeed(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWaterLevel(Float32 level) { _Func->SetWaterLevel(level); }
|
||||
Float32 GetWaterLevel(void) { return _Func->GetWaterLevel(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMaxHeight(Float32 height) { _Func->SetMaxHeight(height); }
|
||||
Float32 GetMaxHeight(void) { return _Func->GetMaxHeight(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetKillCmdDelay(Int32 delay) { _Func->SetKillCmdDelay(delay); }
|
||||
Int32 GetKillCmdDelay(void) { return _Func->GetKillCmdDelay(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetVehiclesForcedRespawnHeight(Float32 height)
|
||||
{ _Func->SetVehiclesForcedRespawnHeight(height); }
|
||||
Float32 GetVehiclesForcedRespawnHeight(void)
|
||||
{ return _Func->GetVehiclesForcedRespawnHeight(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleSyncFrameLimiter(bool toggle)
|
||||
{ _Func->ToggleSyncFrameLimiter(toggle); }
|
||||
bool EnabledSyncFrameLimiter(void)
|
||||
{ return _Func->EnabledSyncFrameLimiter(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleFrameLimiter(bool toggle)
|
||||
{ _Func->ToggleFrameLimiter(toggle); }
|
||||
bool EnabledFrameLimiter(void)
|
||||
{ return _Func->EnabledFrameLimiter(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleTaxiBoostJump(bool toggle)
|
||||
{ _Func->ToggleTaxiBoostJump(toggle); }
|
||||
bool EnabledTaxiBoostJump(void)
|
||||
{ return _Func->EnabledTaxiBoostJump(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleDriveOnWater(bool toggle)
|
||||
{ _Func->ToggleDriveOnWater(toggle); }
|
||||
bool EnabledDriveOnWater(void)
|
||||
{ return _Func->EnabledDriveOnWater(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleFastSwitch(bool toggle)
|
||||
{ _Func->ToggleFastSwitch(toggle); }
|
||||
bool EnabledFastSwitch(void)
|
||||
{ return _Func->EnabledFastSwitch(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleFriendlyFire(bool toggle)
|
||||
{ _Func->ToggleFriendlyFire(toggle); }
|
||||
bool EnabledFriendlyFire(void)
|
||||
{ return _Func->EnabledFriendlyFire(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleDisableDriveby(bool toggle)
|
||||
{ _Func->ToggleDisableDriveby(toggle); }
|
||||
bool EnabledDisableDriveby(void)
|
||||
{ return _Func->EnabledDisableDriveby(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TogglePerfectHandling(bool toggle)
|
||||
{ _Func->TogglePerfectHandling(toggle); }
|
||||
bool EnabledPerfectHandling(void)
|
||||
{ return _Func->EnabledPerfectHandling(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleFlyingCars(bool toggle)
|
||||
{ _Func->ToggleFlyingCars(toggle); }
|
||||
bool EnabledFlyingCars(void)
|
||||
{ return _Func->EnabledFlyingCars(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleJumpSwitch(bool toggle)
|
||||
{ _Func->ToggleJumpSwitch(toggle); }
|
||||
bool EnabledJumpSwitch(void)
|
||||
{ return _Func->EnabledJumpSwitch(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleShowMarkers(bool toggle)
|
||||
{ _Func->ToggleShowMarkers(toggle); }
|
||||
bool EnabledShowMarkers(void)
|
||||
{ return _Func->EnabledShowMarkers(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleStuntBike(bool toggle)
|
||||
{ _Func->ToggleStuntBike(toggle); }
|
||||
bool EnabledStuntBike(void)
|
||||
{ return _Func->EnabledStuntBike(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleShootInAir(bool toggle)
|
||||
{ _Func->ToggleShootInAir(toggle); }
|
||||
bool EnabledShootInAir(void)
|
||||
{ return _Func->EnabledShootInAir(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleShowNametags(bool toggle)
|
||||
{ _Func->ToggleShowNametags(toggle); }
|
||||
bool EnabledShowNametags(void)
|
||||
{ return _Func->EnabledShowNametags(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleJoinMessages(bool toggle)
|
||||
{ _Func->ToggleJoinMessages(toggle); }
|
||||
bool EnabledJoinMessages(void)
|
||||
{ return _Func->EnabledJoinMessages(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleDeathMessages(bool toggle)
|
||||
{ _Func->ToggleDeathMessages(toggle); }
|
||||
bool EnabledDeathMessages(void)
|
||||
{ return _Func->EnabledDeathMessages(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleChatTagsByDefaultEnabled(bool toggle)
|
||||
{ _Func->ToggleChatTagsByDefaultEnabled(toggle); }
|
||||
bool EnabledChatTagsByDefault(void)
|
||||
{ return _Func->EnabledChatTagsByDefault(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateExplosion(Int32 world, Int32 type, const Vector3 & pos, CPlayer & source, Uint32 level)
|
||||
{
|
||||
if (source.Validate())
|
||||
_Func->CreateExplosion(world, type, pos.x, pos.y, pos.z, source.GetID(), level);
|
||||
}
|
||||
|
||||
void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z, CPlayer & source, Uint32 level)
|
||||
{
|
||||
if (source.Validate())
|
||||
_Func->CreateExplosion(world, type, x, y, z, source.GetID(), level);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void HideMapObject(Int32 model, const Vector3 & pos)
|
||||
{ _Func->HideMapObject(model, pos.x, pos.y, pos.z); }
|
||||
void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z)
|
||||
{ _Func->HideMapObject(model, x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ShowMapObject(Int32 model, const Vector3 & pos)
|
||||
{ _Func->ShowMapObject(model, pos.x, pos.y, pos.z); }
|
||||
void ShowMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z)
|
||||
{ _Func->ShowMapObject(model, x, y, z); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ShowAllMapObjects(void)
|
||||
{ _Func->ShowAllMapObjects(); }
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWastedSettings(Uint32 dt, Uint32 ft, Float32 fis, Float32 fos,
|
||||
const Color3 & fc, Uint32 cfs, Uint32 cft)
|
||||
{
|
||||
_Func->SetWastedSettings(dt, ft, fis, fos, fc.GetRGB(), cfs, cft);
|
||||
}
|
||||
|
||||
Table GetWastedSettings()
|
||||
{
|
||||
Uint32 fc, dt, ft, cfs, cft;
|
||||
Float32 fis, fos;
|
||||
Color3 c;
|
||||
_Func->GetWastedSettings(&dt, &ft, &fis, &fos, &fc, &cfs, &cft);
|
||||
c.SetRGB(fc);
|
||||
Table t(DefaultVM::Get());
|
||||
t.SetValue(_SC("dt"), dt);
|
||||
t.SetValue(_SC("ft"), ft);
|
||||
t.SetValue(_SC("fis"), fis);
|
||||
t.SetValue(_SC("fos"), fos);
|
||||
t.SetValue(_SC("fc"), c);
|
||||
t.SetValue(_SC("cfs"), cfs);
|
||||
t.SetValue(_SC("cft"), cft);
|
||||
return t;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWorldBounds(const Vector2 & max, const Vector2 & min)
|
||||
{
|
||||
_Func->SetWorldBounds(max.x, min.x, max.y, min.y);
|
||||
}
|
||||
|
||||
void SetWorldBoundsEx(Float32 max_x, Float32 max_y, Float32 min_x, Float32 min_y)
|
||||
{
|
||||
_Func->SetWorldBounds(max_x, min_x, max_y, min_y);
|
||||
}
|
||||
|
||||
Table GetWorldBounds()
|
||||
{
|
||||
Vector2 max, min;
|
||||
_Func->GetWorldBounds(&max.x, &min.x, &max.y, &min.y);
|
||||
Table t(DefaultVM::Get());
|
||||
t.SetValue(_SC("max"),max);
|
||||
t.SetValue(_SC("min"), min);
|
||||
return t;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
113
source/Misc/World.hpp
Normal file
113
source/Misc/World.hpp
Normal file
@@ -0,0 +1,113 @@
|
||||
#ifndef _MISC_WORLD_HPP_
|
||||
#define _MISC_WORLD_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "SqBase.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetTimeRate(Uint32 rate);
|
||||
Uint32 GetTimeRate(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetHour(Int32 hour);
|
||||
Int32 GetHour(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMinute(Int32 minute);
|
||||
Int32 GetMinute(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWeather(Int32 weather);
|
||||
Int32 GetWeather(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGravity(Float32 gravity);
|
||||
Float32 GetGravity(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetGamespeed(Float32 speed);
|
||||
Float32 GetGamespeed(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWaterLevel(Float32 level);
|
||||
Float32 GetWaterLevel(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetMaxHeight(Float32 height);
|
||||
Float32 GetMaxHeight(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetKillCmdDelay(Int32 delay);
|
||||
Int32 GetKillCmdDelay(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetVehiclesForcedRespawnHeight(Float32 height);
|
||||
Float32 GetVehiclesForcedRespawnHeight(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ToggleSyncFrameLimiter(bool toggle);
|
||||
bool EnabledSyncFrameLimiter(void);
|
||||
void ToggleFrameLimiter(bool toggle);
|
||||
bool EnabledFrameLimiter(void);
|
||||
void ToggleTaxiBoostJump(bool toggle);
|
||||
bool EnabledTaxiBoostJump(void);
|
||||
void ToggleDriveOnWater(bool toggle);
|
||||
bool EnabledDriveOnWater(void);
|
||||
void ToggleFastSwitch(bool toggle);
|
||||
bool EnabledFastSwitch(void);
|
||||
void ToggleFriendlyFire(bool toggle);
|
||||
bool EnabledFriendlyFire(void);
|
||||
void ToggleDisableDriveby(bool toggle);
|
||||
bool EnabledDisableDriveby(void);
|
||||
void TogglePerfectHandling(bool toggle);
|
||||
bool EnabledPerfectHandling(void);
|
||||
void ToggleFlyingCars(bool toggle);
|
||||
bool EnabledFlyingCars(void);
|
||||
void ToggleJumpSwitch(bool toggle);
|
||||
bool EnabledJumpSwitch(void);
|
||||
void ToggleShowMarkers(bool toggle);
|
||||
bool EnabledShowMarkers(void);
|
||||
void ToggleStuntBike(bool toggle);
|
||||
bool EnabledStuntBike(void);
|
||||
void ToggleShootInAir(bool toggle);
|
||||
bool EnabledShootInAir(void);
|
||||
void ToggleShowNametags(bool toggle);
|
||||
bool EnabledShowNametags(void);
|
||||
void ToggleJoinMessages(bool toggle);
|
||||
bool EnabledJoinMessages(void);
|
||||
void ToggleDeathMessages(bool toggle);
|
||||
bool EnabledDeathMessages(void);
|
||||
void ToggleChatTagsByDefaultEnabled(bool toggle);
|
||||
bool EnabledChatTagsByDefault(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CreateExplosion(Int32 world, Int32 type, const Vector3 & pos, CPlayer & source, Uint32 level);
|
||||
void CreateExplosionEx(Int32 world, Int32 type, Float32 x, Float32 y, Float32 z, CPlayer & source, Uint32 level);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void HideMapObject(Int32 model, const Vector3 & pos);
|
||||
void HideMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ShowMapObject(Int32 model, const Vector3 & pos);
|
||||
void ShowMapObjectEx(Int32 model, Float32 x, Float32 y, Float32 z);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ShowAllMapObjects(void);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWastedSettings(Uint32 dt, Uint32 ft, Float32 fis, Float32 fos,
|
||||
const Color3 & fc, Uint32 cfs, Uint32 cft);
|
||||
Table GetWastedSettings();
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SetWorldBounds(const Vector2 & max, const Vector2 & min);
|
||||
void SetWorldBoundsEx(Float32 max_x, Float32 max_y, Float32 min_x, Float32 min_y);
|
||||
Table GetWorldBounds();
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_WORLD_HPP_
|
@@ -1,13 +0,0 @@
|
||||
#include "Misc/WorldBounds.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool Register_CWorldBounds(HSQUIRRELVM vm)
|
||||
{
|
||||
SQMOD_UNUSED_VAR(vm);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
@@ -1,111 +0,0 @@
|
||||
#ifndef _MISC_WORLD_BOUNDS_HPP_
|
||||
#define _MISC_WORLD_BOUNDS_HPP_
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Common.hpp"
|
||||
#include "Base/Vector2f.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
struct CWorldBounds
|
||||
{
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
Vector2f min, max;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds(const Vector2f & vec);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds(const Vector2f & min, const Vector2f & max);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds(const CWorldBounds & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds(CWorldBounds && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
~CWorldBounds();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds & operator= (const CWorldBounds & x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds & operator= (CWorldBounds && x);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds operator+ (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds operator- (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds operator* (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
CWorldBounds operator/ (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator== (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
bool operator!= (const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
SQInteger Cmp(const CWorldBounds & x) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Set() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* ...
|
||||
*/
|
||||
void Get() const;
|
||||
};
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
||||
#endif // _MISC_WORLD_BOUNDS_HPP_
|
Reference in New Issue
Block a user