feat(Globals): Make sure players and screen sizes are updated

This commit is contained in:
Yimura 2020-12-26 19:26:10 +01:00
parent 5a1674881e
commit 8539614d9b
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
4 changed files with 51 additions and 0 deletions

View File

@ -9,6 +9,9 @@ namespace big
{
g_playerId = PLAYER::PLAYER_ID();
update_player_structs();
update_screen_sizes();
god_mode();
off_radar();
no_ragdoll();

View File

@ -26,5 +26,8 @@ namespace big
void god_mode();
void off_radar();
void no_ragdoll();
void update_screen_sizes();
void update_player_structs();
}
}

View File

@ -0,0 +1,33 @@
#include "features.hpp"
namespace big
{
void features::update_player_structs()
{
QUEUE_JOB_BEGIN_CLAUSE(= )
{
for (UINT16 i = 0; i < 32; i++)
{
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
{
g_players[i].is_online = true;
int iNetworkHandle[26];
NETWORK::NETWORK_HANDLE_FROM_PLAYER(i, &iNetworkHandle[0], 13);
NETWORK::NETWORK_IS_HANDLE_VALID(&iNetworkHandle[0], 13) && NETWORK::NETWORK_IS_FRIEND(&iNetworkHandle[0]);
g_players[i].is_friend = NETWORK::NETWORK_IS_HANDLE_VALID(iNetworkHandle, 13) && NETWORK::NETWORK_IS_FRIEND(iNetworkHandle);
strcpy(g_players[i].name, PLAYER::GET_PLAYER_NAME(i));
}
else
{
g_players[i].is_online = false;
g_players[i].is_friend = false;
}
script::get_current()->yield();
}
}QUEUE_JOB_END_CLAUSE
}
}

View File

@ -0,0 +1,12 @@
#include "features.hpp"
namespace big
{
void features::update_screen_sizes()
{
QUEUE_JOB_BEGIN_CLAUSE()
{
GRAPHICS::_GET_ACTIVE_SCREEN_RESOLUTION(&x, &y);
}QUEUE_JOB_END_CLAUSE
}
}