fixed hud message syncing

This commit is contained in:
David Anderson 2006-03-01 00:10:23 +00:00
parent 84b09301e6
commit 62489d05cc

View File

@ -3959,16 +3959,14 @@ static cell AMX_NATIVE_CALL ShowSyncHudMsg(AMX *amx, cell *params)
if (pPlayer->ingame) if (pPlayer->ingame)
{ {
g_langMngr.SetDefLang(i); g_langMngr.SetDefLang(i);
message = UTIL_SplitHudMessage(format_amxstring(amx, params, 3, len));
g_hudset.channel = pPlayer->NextHUDChannel(); g_hudset.channel = pPlayer->NextHUDChannel();
pPlayer->channels[g_hudset.channel] = gpGlobals->time; pPlayer->channels[g_hudset.channel] = gpGlobals->time;
CheckAndClearPlayerHUD(pPlayer, g_hudset.channel, sync_obj); CheckAndClearPlayerHUD(pPlayer, g_hudset.channel, sync_obj);
message = UTIL_SplitHudMessage(format_amxstring(amx, params, 3, len));
UTIL_HudMessage(pPlayer->pEdict, g_hudset, message); UTIL_HudMessage(pPlayer->pEdict, g_hudset, message);
} }
} }
} else { } else {
message = UTIL_SplitHudMessage(format_amxstring(amx, params, 3, len));
if (index < 1 || index > gpGlobals->maxClients) if (index < 1 || index > gpGlobals->maxClients)
{ {
LogError(amx, AMX_ERR_NATIVE, "Invalid player id %d", index); LogError(amx, AMX_ERR_NATIVE, "Invalid player id %d", index);
@ -3982,6 +3980,7 @@ static cell AMX_NATIVE_CALL ShowSyncHudMsg(AMX *amx, cell *params)
g_hudset.channel = pPlayer->NextHUDChannel(); g_hudset.channel = pPlayer->NextHUDChannel();
pPlayer->channels[g_hudset.channel] = gpGlobals->time; pPlayer->channels[g_hudset.channel] = gpGlobals->time;
CheckAndClearPlayerHUD(pPlayer, g_hudset.channel, sync_obj); CheckAndClearPlayerHUD(pPlayer, g_hudset.channel, sync_obj);
message = UTIL_SplitHudMessage(format_amxstring(amx, params, 3, len));
UTIL_HudMessage(pPlayer->pEdict, g_hudset, message); UTIL_HudMessage(pPlayer->pEdict, g_hudset, message);
} }
} }