Post: 99 Skill Broadcast Throughout the Server
11-21-2015, 07:09 PM #1
Stunz
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({});
Basically, all this does, is when a player levels up, it checks, and if the skill happens to be 99, it makes the announcement globally, this can be altered to shout in clan chat or whatever you like.

METHOD 1:

SERVER SIDED


1. Goto
    server.model.players.PlayerAssistant

and search for:
    public void levelUp(int skill) {

This is the method that is called when a player level's up, the skills id, is passed as a parameter to decide what level up interface to show.

2. Directly underneath that, add this if statement:
    if (c.realLevel[skill] == 99) {
for (int x = 0; x < Config.MAX_PLAYERS; x++) {
if (PlayerHandler.players[x] != null) {
Client c2 = (Client)PlayerHandler.players[x];
c2.sendMessage(c.playerName + " has just achieved level 99 in " + getSkillName(skill);
}
}
}

Basically what this code does, if the player's level for whatever skill we are increasing equals 99, it begins the if statement.

Replace
    getSkillName(skill)
with whatever your skill name method is called.

It then uses a for loop:
    for (int x = 0; x < Config.MAX_PLAYERS; x++) {
if (PlayerHandler.players[x] != null) {
Client c2 = (Client)PlayerHandler.players[x];
c2.sendMessage(c.playerName + " has just achieved level 99 in " + getSkillName(skill));

This sends a message to every player in-game.

METHOD 2:

SERVER SIDED


1. Goto
    server.model.players.PlayerAssistant

and search for:
    public void levelUp(int skill) {

This is the method that is called when a player level's up, the skills id, is passed as a parameter to decide what level up interface to show.

2. Directly underneath that, add this if statement:
    if (c.realLevel[skill] == 99) {
for (int x = 0; x < Config.MAX_PLAYERS; x++) {
if (PlayerHandler.players[x] != null) {
Client c2 = (Client)PlayerHandler.players[x];
c2.sendMessage(c.playerName + " has just achieved level 99 in a skill!");
}
}
}

Basically what this code does, if the player's level for whatever skill we are increasing equals 99, it begins the if statement.

It then uses a for loop:
    for (int x = 0; x < Config.MAX_PLAYERS; x++) {
if (PlayerHandler.players[x] != null) {
Client c2 = (Client)PlayerHandler.players[x];
c2.sendMessage(c.playerName + " has just achieved level 99 in a skill!");

This sends a message to every player in-game.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo