Help! Using monoArray not hooking it <Help>

3.Sav.Modz

Platinian
Original poster
May 19, 2021
31
88
8
23
Modding Universe
i know about this
i know how to hook the mono array , the problem is i dont know how to use it after i hook it

according to that tutorial , i am getting the list of the players , but how to use this list , for example to make a masskill
<i know how to make masskill by position and ismine stuff , but with getting pkayers list , idk >

i really hope someone tells me with an example .
 
  • Like
Reactions: MORGAN666

HekaHeka709

Solid & Active Platinian
Dec 29, 2021
57
9
8
20
Phillipines
Just be creative you can do a lot of stuff with the playerList

Example

void (*Kill)(void *instance); //LET'S SAY FOR EXAMPLE YOU HAVE A FUNCTION TO KILL

void (*old_Update)(void *instance); //AND YOU ALSO HAVE UPDATE FUNCTION
void Update(void *instance) {
if (instance != NULL) {
auto players = get_PlayerList(); //YOU GET THE PLAYER LIST LIKE THIS
for (int i; i < players->getLength; i++) {
auto player = players->getPointer();
//NOW PLAYER RIGHT HERE NOW HAVE THE PLAYERS
//NOW LET's SAY YOU WANNA KILL ALL THE PLAYERS
Kill(player);
}
}
old_Update(instance);
}

// WHAT IF I WANNA KILL ONLY THE ENEMY PLAYERS?
//FIND A FUNCTION THAT LIKE GET TEAM ID, GET IS ENEMY, FUNCTIONS LIKE THAT
//NOW IF YOU MANAGED TO FIND ONE YOU CAN HOOK IT LIKE THIS

bool (*get_isEnemy)(void *instance); //EXAMPLE



void (*old_Update)(void *instance);
void Update(void *instance) {
if (instance != NULL) {
auto players = get_PlayerList();
for (int i; i < players->getLength; i++) {
auto player = players->getPointer();
//NOW INSTEAD OF KILLING ALL THE PLAYER LETS KILL ONLY THE ENEMY
bool isEnemy = get_isEnemy(instance);
//IF IT'S ENEMY THEN KILL
if (isEnemy) {
Kill(player);
}
}
}
old_Update(instance);
}
 

dani olmo

Platinian
Apr 26, 2022
19
2
1
24
in your home :0
Just be creative you can do a lot of stuff with the playerList

Example

void (*Kill)(void *instance); //LET'S SAY FOR EXAMPLE YOU HAVE A FUNCTION TO KILL

void (*old_Update)(void *instance); //AND YOU ALSO HAVE UPDATE FUNCTION
void Update(void *instance) {
if (instance != NULL) {
auto players = get_PlayerList(); //YOU GET THE PLAYER LIST LIKE THIS
for (int i; i < players->getLength; i++) {
auto player = players->getPointer();
//NOW PLAYER RIGHT HERE NOW HAVE THE PLAYERS
//NOW LET's SAY YOU WANNA KILL ALL THE PLAYERS
Kill(player);
}
}
old_Update(instance);
}

// WHAT IF I WANNA KILL ONLY THE ENEMY PLAYERS?
//FIND A FUNCTION THAT LIKE GET TEAM ID, GET IS ENEMY, FUNCTIONS LIKE THAT
//NOW IF YOU MANAGED TO FIND ONE YOU CAN HOOK IT LIKE THIS

bool (*get_isEnemy)(void *instance); //EXAMPLE



void (*old_Update)(void *instance);
void Update(void *instance) {
if (instance != NULL) {
auto players = get_PlayerList();
for (int i; i < players->getLength; i++) {
auto player = players->getPointer();
//NOW INSTEAD OF KILLING ALL THE PLAYER LETS KILL ONLY THE ENEMY
bool isEnemy = get_isEnemy(instance);
//IF IT'S ENEMY THEN KILL
if (isEnemy) {
Kill(player);
}
}
}
old_Update(instance);
}
Ok thank you but what about if i wanna output the players name/id?
 

HekaHeka709

Solid & Active Platinian
Dec 29, 2021
57
9
8
20
Phillipines
Ok thank you but what about if i wanna output the players name/id?
Output it like you normally
First loop through playerlist
for (int i = 0; i < players->getLength(); i++) {
auto currentPlayerBeningLooped = players->getPointer();
//THE SITE WOULDN'T LET ME ADD BRACKET JUST ADD OPENING BRACKET, INT VARIABLE NAME WHICH IS 'I' AND CLOSING BRACKET
auto playerName = getName(currentPlayerBeningLooped);
auto playerID = getID(currentPlayerBeningLooped);
}

Now you can store them in a vector or struct and display/output them
 

dani olmo

Platinian
Apr 26, 2022
19
2
1
24
in your home :0
Output it like you normally
First loop through playerlist
for (int i = 0; i < players->getLength(); i++) {
auto currentPlayerBeningLooped = players->getPointer();
//THE SITE WOULDN'T LET ME ADD BRACKET JUST ADD OPENING BRACKET, INT VARIABLE NAME WHICH IS 'I' AND CLOSING BRACKET
auto playerName = getName(currentPlayerBeningLooped);
auto playerID = getID(currentPlayerBeningLooped);
}

Now you can store them in a vector or struct and display/output them
thanks