Quote:
Originally Posted by JLmelenchon
What should i add?
|
Odd that the competitive framework version has the
same return without closing the handle, but go ahead and try this
PHP Code:
public Action:HudDrawTimer(Handle:hTimer)
{
if (IsInReady() || IsInPause())
return Plugin_Handled;
new bool:bSpecsOnServer = false;
for (new i = 1; i <= MaxClients; i++)
{
if (IsSpectator(i))
{
bSpecsOnServer = true;
break;
}
}
if (bSpecsOnServer) // Only bother if someone's watching us
{
new Handle:specHud = CreatePanel();
FillHeaderInfo(specHud);
FillSurvivorInfo(specHud);
FillInfectedInfo(specHud);
FillTankInfo(specHud);
FillGameInfo(specHud);
for (new i = 1; i <= MaxClients; i++)
{
if (!bSpecHudActive[i] || !IsSpectator(i) || IsFakeClient(i))
continue;
SendPanelToClient(specHud, i, DummySpecHudHandler, 3);
if (!bSpecHudHintShown[i])
{
bSpecHudHintShown[i] = true;
CPrintToChat(i, "<{olive}HUD{default}> Escriba {green}!spechud{default} en el chat para alternar el {blue}Espectador HUD{default}.");
}
}
CloseHandle(specHud);
}
new Handle:tankHud = CreatePanel();
if (FillTankInfo(tankHud, true))
{
for (new i = 1; i <= MaxClients; i++)
{
if (!bTankHudActive[i] || !IsClientInGame(i) || IsFakeClient(i) || IsSurvivor(i) || (bSpecHudActive[i] && IsSpectator(i)))
continue;
SendPanelToClient(tankHud, i, DummyTankHudHandler, 3);
if (!bTankHudHintShown[i])
{
bTankHudHintShown[i] = true;
CPrintToChat(i, "<{olive}HUD{default}> Escriba {green}!tankhud{default} en el chat para alternar el {red}Tank HUD{default}.");
}
}
}
CloseHandle(tankHud);
return Plugin_Continue;
}