Author Topic: Click-Stats [v2.2]  (Read 6883 times)

Description
Click on players to display their stats (screenshot attached)

New Features for v2.2
 - added score to stats
 - added rtb prefs to enable/disable each stat separately
 - health stat now supports custom player-types with health over 100 (thanks Lugnut)
 - added '/stats' to check your own stats

Installation
Put Script_Clickstats.zip into the Add-Ons folder in your Blockland folder.

Download
Script_Clickstats.zip (1.43kb)


screenshot is from v1.
« Last Edit: May 04, 2012, 01:10:29 AM by 420 »

Cool, but isn't it kinda silly so show the name when you already see it?

Cool, but isn't it kinda silly so show the name when you already see it?
Maybe it doesn't show the persons name above their head

edit: Is this a client side or a server mod?

Maybe it doesn't show the persons name above their head

edit: Is this a client side or a server mod?

It's server-sided and includes an rtb pref to enable/disable it

It's server-sided and includes an rtb pref to enable/disable it
Oh wow this is great,

You should make it where it shows up when you aim at the player

Very useful, is it a possibility for it to display a desired variable? So you could add information to be displayed, like <var:cl:eggs>

Very useful, is it a possibility for it to display a desired variable? So you could add information to be displayed, like <var:cl:eggs>

I suppose I could try adding that to the next update.  Score is also another thing I'll  likely add.
« Last Edit: May 01, 2012, 08:52:13 AM by 420 »

:o

Would go very well with some mods, such as the upcoming traitors vs innocents or something.

You should make it where it shows up when you aim at the player, that would be great!


Then it would have to constantly shoot raycasts
Or am I wrong

Cool, but isn't it kinda silly so show the name when you already see it?

f5

Then it would have to constantly shoot raycasts
Or am I wrong
It does it on the Orange block

Oh wow this is great,

You should make it where it shows up when you aim at the player
I was thinking this too, would be good for like in a TDM...medics can check health of other players

Alright, let's get a few things out of the way here.
A: You're THC, the friend that got himself banned from yorktowns server for being a dooschebag.
I'm glad to see you're not a dooschebag.

B:
Code: [Select]
function Player::activateStuff(%player)This is OK. Your script will work perfectly fine, but around here, we typically format it as follows:
Code: [Select]
function Player::activateStuff(%this)where %this refers to the PLAYER that ACTIVATESTUFF was called on.

It makes sense if you think about it.

C:
Code: [Select]
if(%health < 36)
{
%health = "\c0" @ %health;
}
else
{
if(%health < 71)
{
%health = "\c3" @ %health;
}
else
{
if(%health < 101)
{
%health = "\c2" @ %health;
}
}
}
Use a little thing called switches.
Switches don't work here, but you could do the above far better.
Code: [Select]
if(%health < 101)
{
%health = "\c2" @ %health;
}
else if(%health < 71)
{
%health = "\c3" @ %health;
}
else if(%health < 36)
{
%health = "\c0" @ %health;
}
Look, it works just as well, doesn't require a forgetton of else statements, and it doesn't forget up syntax highlighting in my text editor.

OR EVEN BETTER
Code: [Select]
if(%health > 100)
%health = "\c5" @ %health;
else if(%health < 101)
%health = "\c2" @ %health;
else if(%health < 71)
%health = "\c3" @ %health;
else if(%health < 36)
%health = "\c0" @ %health;

Holy bejeebus batman, where did all those lines go? we're down to 6!
You probably noticed this, but in the last example, I added a if greater than 100, for custom playertype.
« Last Edit: May 01, 2012, 03:48:34 PM by Lugnut1206 »

The last three if statements should actually be else if statements. If the health is over 100, for example, the script will check the score four times even though the color is already found to be greater than 100. If the statements use else, the function is more efficient.