Blockland Forums > Modification Help

"Looping" something in the bottom print?

Pages: << < (2/3) > >>

Daenth:


--- Quote from: otto-san on June 09, 2011, 01:00:55 AM ---
--- Code: ---function tickthing()
{
  cancel($tickthing);
  //STUFF
  $tickthing = schedule(time,0,tickthing);
}
--- End code ---

--- End quote ---
Alright, so I have that...

--- Code: ---function displayscore(%client, %mini)
{
   cancel($GunGame::DisplayScore);
   //stuff
   $GunGame::DisplayScore = schedule(3000,0,displayscore);


--- End code ---
And I have a command that triggers it, I tried both displayscore(); and $GunGame::DisplayScore = schedule(3000,0,displayscore); and neither have worked. =/

Destiny/Zack0Wack0:


--- Quote from: Daenth on June 09, 2011, 03:01:35 AM ---Alright, so I have that...

--- Code: ---function displayscore(%client, %mini)
{
   cancel($GunGame::DisplayScore);
   //stuff
   $GunGame::DisplayScore = schedule(3000,0,displayscore);


--- End code ---
And I have a command that triggers it, I tried both displayscore(); and $GunGame::DisplayScore = schedule(3000,0,displayscore); and neither have worked. =/

--- End quote ---
Did you add the actual centerprint code?

Daenth:


--- Quote from: Destiny/Zack0Wack0 on June 09, 2011, 03:07:27 AM ---Did you add the actual centerprint code?

--- End quote ---
Yeah, I have the bottomprint stuff in there.

Daenth:

Alright, so this is how my loop is activated...

--- Code: ---function serverCmdtogglegungame(%client)
{
if(!%client.isSuperAdmin)
{
messageClient(%client, '', "\c0You are not allowed to use this command.");
return;
}

if($GunGame::Status == 0)
{
activatePackage(GunGame);
chatMessageAll(%client, "\c6Gun Game Enabled!");
$GunGame::Status = 1;
$GunGame::DisplayScore = schedule(3000,0,displayscore);
$GunGame::GrenadeTickLoop = schedule(100,0,grenadetickloop);
return;
}
        //The rest of the stuff...
--- End code ---

and this is my loop.


--- Code: --- function displayscore(%client,%mini) //Displaying the score to the clients.
{
cancel($GunGame::DisplayScore);
%leveldiff = %client.score - %mini.member0.score;
if(%leveldiff > 0)
commandToClient(%client, 'BottomPrint', "\c3You are at level \c6" @ %client.score @ "\c3. You are \c6" @ %leveldiff @ "\c3 levels behind the leader.", 3);
else
commandToClient(%client, 'BottomPrint', "\c3You are at level \c6" @ %client.score @ "\c3. You are the leader!", 3);
$GunGame::DisplayScore = schedule(3000,false,displayscore);
}
--- End code ---

I tried triggering the loop with displayscore(); and it did not work. I tried switching out 0 for false (yes, I know they are the same thing. I just wanted to see if it would work) and that didn't work.

What am I doing wrong? :o

otto-san:

This is (basically) the code I used. I used a servercmd and a time of -1. Even though it's -1, it goes away after about three minutes, so every three minutes, it brings it back up.

--- Code: ---function serverCmdInfo(%client)
{
commandToClient(%client,'bottomPrint',"TEXT", -1, 2, 3, 4);
}
--- End code ---


--- Code: ---function thing_tick()
{
cancel($thingTick);
for(%i = 0; %i < clientGroup.getCount(); %i++)
serverCmdInfo(%client);
$thingTick = schedule(3*60000,0,thing_tick);
}
--- End code ---


Pages: << < (2/3) > >>

Go to full version