entity.get_origin(entindex)
Returns the entity’s origin world coordinates, or nil if information is unavailable.