Blockland Forums > Modification Help

Detecting when someone's score changes?

Pages: (1/3) > >>

Daenth:

Iban told me that it was GameConnection::incScore but that didn't work for me. Is there any way to detect if someone's score changes?

Wheatley:

What are you using it for? There could be another way, depending on what the score will represent.
Also, post the function that you used.

Greek2me:


--- Code: ---package blah
function GameConnection::setScore(%client,%flag)
{
parent::setScore(%client,%flag);

//do stuff
}
};
--- End code ---

This is better than incScore because it works when you set the score and when you just increase it.

Daenth:


--- Quote from: Greek2me on June 03, 2011, 09:22:13 PM ---
--- Code: ---package blah
function GameConnection::setScore(%client,%flag)
{
parent::setScore(%client,%flag);

//do stuff
}
};
--- End code ---

This is better than incScore because it works when you set the score and when you just increase it.

--- End quote ---
Using this, is there any way you can make it do stuff every time the score increments by 2? For example, when you kill someone you get one point. But, for every two points you get something happens.

On a side note: Is there any way to detect if a player has respawned. Also, is there a list of all these things like GameConnection::setScore?

otto-san:

You could check to see if the score afterwards is a multiple of two.

Pages: (1/3) > >>

Go to full version