2004-05-26 05:15:40 +00:00
|
|
|
#ifndef _MSGS_INCLUDE_H
|
|
|
|
#define _MSGS_INCLUDE_H
|
|
|
|
|
|
|
|
#include "engine.h"
|
|
|
|
|
|
|
|
#define MAX_MESSAGES 255
|
|
|
|
|
|
|
|
#define BLOCK_NOT 0
|
|
|
|
#define BLOCK_ONCE 1
|
|
|
|
#define BLOCK_SET 2
|
|
|
|
|
2005-07-22 09:26:37 +00:00
|
|
|
enum msgtype
|
|
|
|
{
|
2004-05-26 05:15:40 +00:00
|
|
|
arg_byte = 1,
|
|
|
|
arg_char,
|
|
|
|
arg_short,
|
|
|
|
arg_long,
|
|
|
|
arg_angle,
|
|
|
|
arg_coord,
|
|
|
|
arg_string,
|
|
|
|
arg_entity,
|
|
|
|
};
|
|
|
|
|
2005-07-22 09:26:37 +00:00
|
|
|
struct msgparam
|
2004-05-26 05:15:40 +00:00
|
|
|
{
|
2005-07-22 09:26:37 +00:00
|
|
|
msgtype type;
|
2005-07-19 16:14:52 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
REAL fData;
|
|
|
|
int iData;
|
|
|
|
} v;
|
2005-07-22 09:26:37 +00:00
|
|
|
String szData;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Message
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Message();
|
|
|
|
~Message();
|
|
|
|
void AddParam(float data, msgtype type);
|
|
|
|
void AddParam(int data, msgtype type);
|
|
|
|
void AddParam(const char *data, msgtype type);
|
|
|
|
void SetParam(size_t index, float data);
|
|
|
|
void SetParam(size_t index, int data);
|
|
|
|
void SetParam(size_t index, const char *data);
|
|
|
|
const char *GetParamString(size_t index);
|
|
|
|
float GetParamFloat(size_t index);
|
2005-07-29 20:15:08 +00:00
|
|
|
bool Ready();
|
|
|
|
void Init();
|
2005-07-22 09:26:37 +00:00
|
|
|
int GetParamInt(size_t index);
|
|
|
|
msgtype GetParamType(size_t index);
|
|
|
|
void Reset();
|
|
|
|
void Send();
|
|
|
|
size_t Params();
|
|
|
|
private:
|
|
|
|
msgparam *AdvPtr();
|
|
|
|
private:
|
|
|
|
CVector<msgparam *> m_Params;
|
|
|
|
size_t m_CurParam;
|
2004-05-26 05:15:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern AMX_NATIVE_INFO msg_Natives[];
|
2004-08-30 22:24:43 +00:00
|
|
|
extern CVector<int> msgHooks[256];
|
2004-06-24 07:36:43 +00:00
|
|
|
extern int msgBlocks[256];
|
2004-05-26 05:15:40 +00:00
|
|
|
|
2004-08-24 05:44:31 +00:00
|
|
|
#endif //_MSGS_INCLUDE_H
|
|
|
|
|