Aight so I been tryna use Contains to get a player in an with an ID
I must be wrong about the way I’m using it cause I get this error
Does anyone know the right way to use it? Or a way I could fix what I got going on
This is the monoArray struct I’m using
I must be wrong about the way I’m using it cause I get this error
Does anyone know the right way to use it? Or a way I could fix what I got going on
This is the monoArray struct I’m using
C++:
template <typename T>
struct monoArray
{
void* klass;
void* monitor;
void* bounds;
int max_length;
void* vector [1];
int getLength()
{
return max_length;
}
T getPointer()
{
return (T)vector;
}
T operator [] (int i)
{
return getPointer()[i];
}
const T operator [] (int i) const
{
return getPointer()[i];
}
bool Contains(T item)
{
for (int i = 0; i < max_length; i++)
{
if(getPointer()[i] == item) return true;
}
return false;
}
};
Last edited: