fix(JoinMessage): Fixed join player message to be more efficient
This commit is contained in:
parent
4f0cfcba75
commit
6b06ed9133
@ -3,22 +3,18 @@
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
void features::join_message()
|
void features::join_message(Player player)
|
||||||
{
|
{
|
||||||
bool bJoinMessage = g_settings.options["join_message"].get<bool>();
|
bool bJoinMessage = g_settings.options["join_message"].get<bool>();
|
||||||
|
|
||||||
if (bJoinMessage)
|
if (bJoinMessage)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 32; i++) {
|
char joinMsg[64];
|
||||||
if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i)) && ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i))) {
|
strcpy(joinMsg, "<C>");
|
||||||
char joinMsg[64];
|
strcat(joinMsg, g_pointers->m_get_player_name(player));
|
||||||
strcpy(joinMsg, "<C>");
|
strcat(joinMsg, "</C> is joining.");
|
||||||
strcat(joinMsg, g_pointers->m_get_player_name(i));
|
|
||||||
strcat(joinMsg, "</C> is joining.");
|
|
||||||
|
|
||||||
features::notify::above_map(joinMsg);
|
features::notify::above_map(joinMsg);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,6 +10,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
|
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
|
||||||
{
|
{
|
||||||
|
if (!g_players[i].is_online) features::join_message((Player)i);
|
||||||
|
|
||||||
g_players[i].is_online = true;
|
g_players[i].is_online = true;
|
||||||
|
|
||||||
int iNetworkHandle[26];
|
int iNetworkHandle[26];
|
||||||
|
Reference in New Issue
Block a user