I'm trying to use GetEntDataString to fetch string_t m_ModelName defined in baseentity.h.
GetEntDataString will just return some garbage which might be a raw pointer value since it contains non printable characters and is equal for two entities using the same model.
My example code:
Code:
stock getBlockType(const entity) {
if (!IsValidEntity(entity)) {
return BLOCK_TYPE_INVALID;
} else {
new offset = FindDataMapOffs(entity, "m_ModelName");
SayToAll("offset m_ModelName: %i", offset);
if (offset != -1) {
new String:buffer[255];
GetEntDataString(entity, offset, buffer, 255);
SayToAll("block model: %s", buffer);
return BLOCK_TYPE_UNKNOWN;
} else {
return BLOCK_TYPE_INVALID;
}
}
}
How can i get the real model string?