[TUT][508/317]Kill counter

Results 1 to 4 of 4
  1. #1
    Account Upgraded | Title Enabled! TehByte is offline
    MemberRank
    Nov 2008 Join Date
    313Posts

    [TUT][508/317]Kill counter

    Ok, well this tutorial will show you how to make a simple kill counter.

    Firstly we will need to make an int, I will call it deathCount.
    Code:
    public static int deathCount = 0;
    This integer is public, so anything we add to it will change for the whole server. We do not need to add saving as this is for how many kills happend on the server from when it restarted (Per day or what ever).

    So, then we need to add the code to +1 for each death, so you will need to find your death process then add the following code to it
    Code:
    p.deathCount = +1;
    That is the code for 508, for 317 I think you just take off the 'p.'

    Now we need to display the message to the server (in a command or when you click on an interface, I will show you how to do it when you click on an interface.

    508:
    Code:
    case #;
    p.frames.sendMessage(p, "So far today " +p.deathCount+ " players have died on SERVERNAME";
    break;
    317:
    Code:
    case #;
    sendMessage("So far today " +deathCount+ " players have died on SERVERNAME";
    break;


  2. #2
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [TUT][508/317]Kill counter

    Not bad... I'd use this in combination with a pvp-type minigame... But have it player based, and have like a top 5 or w/e. Good to see a new post by you :3

  3. #3
    Venture Adventure Tyler is offline
    LegendRank
    Nov 2008 Join Date
    United KingdomLocation
    4,443Posts

    Re: [TUT][508/317]Kill counter

    Yeh, he added this to EvolutionScape which will be released soon.

  4. #4
    Account Upgraded | Title Enabled! TehByte is offline
    MemberRank
    Nov 2008 Join Date
    313Posts

    Re: [TUT][508/317]Kill counter

    Hmmm, well in EvolutionScape we are using this for a public kill counter (see how many players have died obviosly).

    You can also use this method in a death process, say you wanted a player kill count for how many men they have killed you would simply do:
    int playerManKillcount = 1;

    then in the NPC death process (making sure your NPC methods read p.) you would add:
    if (npcID = 1) {
    p.playerManKillcount = +1;
    }

    It's easy to apply this code to a range of different games, minigames whatever throughout the server.



Advertisement