* UPDATED! change was need in order to make the code compatible with the version 7.4.2+ *
- Code: Select all
using System;
namespace MCDzienny
{
public class CmdCustomScoreCounting : Command
{
// Don't change it.
public override string name { get { return ""; } }
public override string shortcut { get { return ""; } }
public override string type { get { return ""; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
// Init is executed when the code is loaded.
public override void Init()
{
// You tell the server to send arguments to CustomScoreCounting method when CountScore event occures.
LavaSystem.CountScore -= LavaSystem.CountScoreDefault;
LavaSystem.CountScore += CustomScoreCounting;
}
// Here's the place where you are supposed to write your score counting method.
// Player p - represents a player that was among the winners,
// int blocksAround - describes how many blocks were around the player at the end of the round,
// mind that blocks that were located below the sea level are counted as 0,3 of a normal block.
// The counted score has to be written to 'p.score' as in example below.
private void CustomScoreCounting(Player p, int blocksAround)
{
p.score = 150 + blocksAround + p.lives * 20;
}
// Don't change it.
public override void Help(Player p) { }
public override void Use(Player p, string message) { }
}
}