Im trying to get the playerlist...
here's the array struct, (found in some unity.h file on github)
heres my pointer to the photon array:
Heres my hook code:
Heres my console error:
I tried the method on this forum that tiuu posted but I would get this error:
How do I get this shit working?
here's the array struct, (found in some unity.h file on github)
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;
}
};
C++:
monoArray<void *> *(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void *> *(*)())getRealOffset(0x1018291A8);
C++:
monoArray<void **> *photonplayers = PhotonNetwork_get_OtherPlayers();
for (int i = 0; i < photonplayers->getLength(); ++i)
{
void *ePlayerr = photonplayers->getPointer()[i];
//do some shit. (set positions, scale objects ect.)
}
Code:
Tweak.xm:482:21: error: cannot initialize a variable of type
'monoArray<void **> *' with an rvalue of type 'monoArray<void *> *'
monoArray<void **> *photonplayers = PhotonNetwork_get_OtherPlayers();
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tweak.xm:486:11: error: unused variable 'ePlayerr' [-Werror,-Wunused-variable]
void *ePlayerr = photonplayers->getPointer()[i];
^
//ignore the 2nd error, thats just because I didnt use the variable in anything cuz I removed my mod code using it
Code:
Tweak.xm:486:48: error: subscript of pointer to incomplete type 'void'
auto ePlayerr = photonplayers->getPointer()[i];
Last edited: