amxmodx/dlls/engine/messages.h

66 lines
1.1 KiB
C
Raw Normal View History

2004-05-26 09:15:40 +04: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 13:26:37 +04:00
enum msgtype
{
2004-05-26 09:15:40 +04:00
arg_byte = 1,
arg_char,
arg_short,
arg_long,
arg_angle,
arg_coord,
arg_string,
arg_entity,
};
2005-07-22 13:26:37 +04:00
struct msgparam
2004-05-26 09:15:40 +04:00
{
2005-07-22 13:26:37 +04:00
msgtype type;
2005-07-19 20:14:52 +04:00
union
{
REAL fData;
int iData;
} v;
2005-07-22 13:26:37 +04: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);
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 09:15:40 +04:00
};
extern AMX_NATIVE_INFO msg_Natives[];
extern CVector<int> msgHooks[256];
extern int msgBlocks[256];
2004-05-26 09:15:40 +04:00
2004-08-24 09:44:31 +04:00
#endif //_MSGS_INCLUDE_H