fix(JoinMessage): Fixed join player message to be more efficient

This commit is contained in:
Yimura 2020-12-29 00:13:13 +01:00
parent fa95229cf3
commit 8df2f5e55f
2 changed files with 8 additions and 10 deletions

View File

@ -3,22 +3,18 @@
namespace big
{
void features::join_message()
void features::join_message(Player player)
{
bool bJoinMessage = g_settings.options["join_message"].get<bool>();
if (bJoinMessage)
{
for (int i = 0; i < 32; i++) {
if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i)) && ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i))) {
char joinMsg[64];
strcpy(joinMsg, "<C>");
strcat(joinMsg, g_pointers->m_get_player_name(i));
strcat(joinMsg, "</C> is joining.");
char joinMsg[64];
strcpy(joinMsg, "<C>");
strcat(joinMsg, g_pointers->m_get_player_name(player));
strcat(joinMsg, "</C> is joining.");
features::notify::above_map(joinMsg);
}
}
features::notify::above_map(joinMsg);
}
}
}

View File

@ -10,6 +10,8 @@ namespace big
{
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
{
if (!g_players[i].is_online) features::join_message((Player)i);
g_players[i].is_online = true;
int iNetworkHandle[26];