01-06-2019, 10:57 AM
I made this code that run but I don't see any scoreboard :/
Code:
---Main file
PLUGIN = nil
function Initialize(Plugin)
--Initialisation
Plugin:SetName('ValeaCore');
Plugin:SetVersion(0.1);
--Events
cPluginManager:AddHook(cPluginManager.HOOK_WORLD_TICK, scoreBoardTask);
PLUGIN = Plugin;
LOG(Plugin:GetName()..' loaded in version '..Plugin:GetVersion());
return true
end
function OnDisable(Plugin)
LOG(Plugin:GetName().. 'disabled');
end
--Scoreboard file
function updateScoreBoard(World)
World:GetScoreBoard():RegisterObjective('cos', 'Joueurs en ligne:', 4);
World:GetScoreBoard():SetDisplay('cos', 2);
World:GetScoreBoard():SetDisplay('cos', 0)
end
function scoreBoardTask(World, TimeDelta)
cRoot:Get():ForEachWorld(updateScoreBoard);
end
I know that scoreBoardTask is running becasue is tried logging ^^