Modified sample of script written in Java ( March 27, 2020 )

Started by Mateus, Mar 27, 2020, 07:14 PM

Previous topic - Next topic

Mateus


MODIFIED SCRIPT SAMPLE
   
In order to facilitate and encourage contributions and development of servers written in Java for Vice City Multiplayer, we publish this modification of Newk5's sample Java script. This modification will be updated constantly, bringing new commands and features.



To get started, follow the step-by-step below

Install Microsoft Visual C++ 2010 Redistributable Package
x64 - https://www.microsoft.com/en-US/Download/confirmation.aspx?id=14632
x86 - https://www.microsoft.com/en-us/download/confirmation.aspx?id=5555

Install Microsoft Visual C++ 2010 SP1 Redistributable Package
x64 - https://www.microsoft.com/en-us/download/confirmation.aspx?id=13523
x86 - https://www.microsoft.com/en-us/download/confirmation.aspx?id=8328

Install Visual C++ Redistributable Packages for Visual Studio 2013
https://www.microsoft.com/en-us/download/details.aspx?id=40784

Install Visual C++ Redistributable for Visual Studio 2015
https://www.microsoft.com/pt-br/download/details.aspx?id=48145

Java SE Development Kit 8
https://www.oracle.com/java/technologies/javase-jdk8-downloads.html

Install Apache NetBeans
https://netbeans.apache.org/download/index.html

Follow the instructions in vcmp-sample-script
https://github.com/onemediainternational/vcmp-sample-script.git
Be aware that the teams and vehicles present in this modification were ported from the Warchief 2.0 script



one media team of game servers
Lauro de Freitas, Bahia, Brasil
2020.1

KX

Usage of .sleep is not recommended as it will hang up the whole server thread for 5 seconds
public void heal(Player player) throws InterruptedException{
        TimeUnit.SECONDS.sleep(5);
        player.setHealth(100);
    }
its better to use proper timer than using .sleep as timer
public void heal(Player player) {
 timerRegistry.register(false, 5000, new Runnable() {
  @Override
  public void run() {
   player.setHealth(100);
  }
 });

}