Author Topic: type /brickcount modification - shows the brick count out of the brick limit  (Read 1705 times)

I think this would be useful. when you type /brickcount it shows you how many bricks are on the server. What I am requesting is a modification so it does not show simply x bricks but x/x bricks. Such as the brick limit is 256,000 and the brick count is 29.746 when you type /brickcount instead of 29746 bricks it would be 29746/256000 bricks. It would be helpful for large projects where avoiding the brick limit is important.

Try this:

Code: server.cs (4 lines)
function serverCmdBrickCount(%client)
{
    messageClient(%client, '', "\c4" @ getBrickCount() @ "\c6 / \c4" @ getBrickLimit() @ "\c6 bricks");
}


Nonono, OP clearly states that he wantes brickcount/bricklimit.


function serverCmdBrickCount(%client)
{
    messageClient(%client, '', "\c4" @ getBrickCount() / getBrickLimit() @ "\c6 bricks");
}

that will give a percentage which the OP didn't want (he used . as the radix or w/e as is done in many countries)

zeblote's code would be correct

Try this:

Code: server.cs (4 lines)
function serverCmdBrickCount(%client)
{
    messageClient(%client, '', "\c4" @ getBrickCount() @ "\c6 / \c4" @ getBrickLimit() @ "\c6 bricks");
}

So I just insert this into the server.cs file?

that will give a percentage which the OP didn't want (he used . as the radix or w/e as is done in many countries)

zeblote's code would be correct
OP wants the brickcount to be divided by the bricklimit. What I put is correct.

OP wants the brickcount to be divided by the bricklimit. What I put is correct.
no as in
29746/256000
or
12419 out of 256000

OP wants the brickcount to be divided by the bricklimit. What I put is correct.
when you type /brickcount instead of 29746 bricks it would be 29746/256000 bricks.

So I just insert this into the server.cs file?
Yes, put this in a new server.cs file and add a description.txt (you don't need to put anything in the description.txt) and put both of those files into a folder called Script_NewBrickCount in your add-ons folder. You can zip this folder, but it's not necessary. After that, you will be able to select Script_NewBrickCount as an add-on.

no as in
29746/256000
or
12419 out of 256000
bingo

Yes, put this in a new server.cs file and add a description.txt (you don't need to put anything in the description.txt) and put both of those files into a folder called Script_NewBrickCount in your add-ons folder. You can zip this folder, but it's not necessary. After that, you will be able to select Script_NewBrickCount as an add-on.
I believe I have done this wrong since it not showing up in-game. I did exactly as you have instructed yet it does not show up, is there a reason for this?

I believe I have done this wrong since it not showing up in-game. I did exactly as you have instructed yet it does not show up, is there a reason for this?
What exactly did you do?

What exactly did you do?
I made a text document and copied the four lines of code into it, than saved it as server.cs so it became a CS file. I added a description.txt document and placed both within a zipped folder titled Script_NewBrickCount and started the game, it did not show up in the addons listings.

You probably have a folder inside the zip or something

Just skip the zip file, it's only necessary if you want to release it

Make folder in add-ons folder titled "Script_Whatever"
Put server.cs and description.txt in that folder

You probably have a folder inside the zip or something

Just skip the zip file, it's only necessary if you want to release it

Make folder in add-ons folder titled "Script_Whatever"
Put server.cs and description.txt in that folder
theres not, I only zipped it after trying to use just a folder.

Alright found the problem, it is stupid just like I am. Since the CS file needed to be labeled server.cs I thought it was the same for the text file so I named it description.txt instead of just description. Alright it works thanks, locking.