get_field_basetype
- Синтаксис
-
stock BaseFieldType:get_field_basetype(FieldType:type, type_name[] = "", maxlen = 0) { static const baseFieldTypeNames[BaseFieldType][] = { "none", "integer", "float", "vector", "entity", "string", }; new BaseFieldType:baseType = BASEFIELD_NONE; switch (type) { case FIELD_INTEGER, FIELD_STRINGINT, FIELD_SHORT , FIELD_CHARACTER, FIELD_CLASS , FIELD_STRUCTURE, FIELD_POINTER, FIELD_FUNCTION, FIELD_BOOLEAN: { baseType = BASEFIELD_INTEGER; } case FIELD_FLOAT: { baseType = BASEFIELD_FLOAT; } case FIELD_VECTOR: { baseType = BASEFIELD_VECTOR; } case FIELD_CLASSPTR, FIELD_ENTVARS, FIELD_EDICT, FIELD_EHANDLE: { baseType = BASEFIELD_ENTITY; } case FIELD_STRINGPTR, FIELD_STRING: { baseType = BASEFIELD_STRING; } } if (maxlen > 0) { copy(type_name, maxlen, baseFieldTypeNames[baseType]); } return baseType; }
Переменная | Описание |
---|---|
type |
Class member type (FIELD_* constants) |
type_name |
Optional buffer to store base type name in |
maxlen |
Maximum size of the buffer |
- Описание
- Returns the data field base type based off a specific field type.
- Пометка
-
From an AMXX plugin perspective, the (C++/engine) data types can be grouped in five base types: integer, float, vector, entity and string. This stock is essentially for convenience and debug purpose.
- Возвращает
- Base field type (BASEFIELD_* constants)