Hello. I am currently working on Annihilation, a teambased conquering game. I am a noob to coding but it is my project so I took it under myself to do it as I want to not rely completely on others to get my dirty work done.
Basically, I'm trying to get a way for my code to edit a minigame on a event. I was making it so each nexus on destroy to make that team have 1 life left. The add-on is already the kind of gamemode where it is not automated. Example: /startanni starts the game. This is because the add-on needs so and so players to make it fun so the sessions are planned out. However, I would like to make the minigame editing automated as that seems to make the code seem lazy.
function serverCmdStartAnni(%client)
{
if(%client.isAdmin)
{
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%clientB = ClientGroup.getObject(%cl);
%clientB.centerPrint("<font:impact:50><color:f420eb>Annihilation round begins in 30 seconds! Prepare yourself!",5);
}
%time = 30;
serTimer(%time);
}
else
{
messageClient(%client, '', '\c6Only Admins can Start Annihilation!');
}
}
function serTimer(%time)
{
if (%time <= 0)
{
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%clientB = ClientGroup.getObject(%cl);
%clientB.centerPrint("<font:impact:50><color:f420eb>This Annihilation round has begun!",5);
%clientB.bottomPrint("<color:f420eb>Phase: <color:ffffff>1 <color:1818ba>Team: <color:ffff00>Yellow");
}
}
else
{
%time--;
$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}
}
That is my code so far. I also want the minigame to force people on to teams when they spawn too. They can choose there team though. If I can get problems done like this, I can be a better coder in the long run. Thanks!