- Updated "/script reload" command to support individual scripts as an additional argument.
- Example Usage: /script reload someScriptName
- Added an "extras" key-value pair to add additional MySQL Connection String options.
- Note: Those requiring no SSL can use the value: 'SslMode=None;'
- Full list of options here: https://www.connectionstrings.com/mysql/
- Fixed onPlayerExperienceUpdated event.
- Fixed vehicle.removePlayer() function.
Ster • Message Link
- Fixed onPlayerRespawned event.
- Fixed player markers.
- Fixed usages of Unturned code now marked as "Obsolete".
- Added server.getBarricadesInRadius(position, radius).
- Added server.getStructuresInRadius(position, radius).
- Added spawner.spawnBarricade(id, position, [angleX], [angleY], [angleZ], [owner], [group]) function.
- Added spawner.spawnStructure(id, position, [angleX], [angleY], [angleZ], [owner], [group]) function.
- Added barricade.health property.
- Added barricade.maxHealth property.
- Added barricade.damage(amount) function.
- Added barricade.repair(amount) function.
- Added structure.health property.
- Added structure.maxHealth property.
- Added structure.damage(amount) function.
- Added structure.repair(amount) function.
- Added vehicle.maxHealth property.
- Added vehicle.speed property.
- Added vehicle.maxSpeed property.
- Added vehicle.minSpeed property.
- Added vehicle.damage(amount, [canRepair]) function.
- Added vehicle.repair(amount) function.
- Added vehicle.repairTires() function.
Ster • Message Link
========== Additions ==========
- Added support for discord embeds.
- Added additional support for UI text components along with a player.ui subtype.
- Added support for passing a function to another function and calling it.
- Example usage:
- example(print); // calling the function defined below
function example(func){ func("Hello World!); // will call print("Hello World!") as print the print function is the argument from above }
- Added several new language features:
- Dedicated Constructors
- Example usage: vector3(10, 0, 10)
- Another example: discordEmbed()
- Dedicated Constructors
- Postfix operators
- Example usage: index++ or index--
- Binary operators:
- Example usage: index += 5 or index *= 3
- Ternary Conditional operator
- Example usage: player.health < 90 ? player.heal() : player.message("You must have less than 90 health to heal.");
- Not operator:
- Example usage: if(!player.hasGroup("example"))
- Implicit Negatives:
- You can now write print(-5); directly instead of the old print(0 - 5); workaround from before
- Support for both else if and elseif
- Objects (usage subject to change):
- Example usage:
myObj = { data: "some random string data", num: 10, }; myObj["data"] = "Some new string data"; myObj["num"]++; print(myObj["data"]);
- For loops:
- Example usage:
for (i = 0; i < 10; i++) { print(i); }
- Example usage:
- Switch statements:
- Example usage:
switch (myNumber) { case 5: print("The number was 5"); break; case 8: print("The number was lucky number 8"); break; default: print("The number was neither 5 nor 8"); break; }
- Example usage:
========== Changes ==========
- Changed several functions prefixed with get/set to properties.
- toString() should now be used as an instance method instead of a global method.
- Example usage: player.health.toString()
- Another example: vector3(10, 20, 30).toString()
- str.format() is now an instance function for string types.
- Example usage: "Hello {0}!".format("World")
- Another example: myString.format("One", "Two", "Three")
- toNumber() is now an instance function for string types.
- Example usage: arguments[2].toNumber()
- Note: arguments is a string array that is implicitly defined for commands.
- Removed/Deprecated isSet(), isPlayer(), isStructure(), etc.
- Instead, you should use the type property (valid for all types) or check for null (if applicable) for these comparisons.
- Example type check: if(player.type == "player")
- Another example: if(arrayValue.type == "number")
- Example null check: if(player == null)
- Instead, you should use the type property (valid for all types) or check for null (if applicable) for these comparisons.
- v3 type has been removed. All vector3 properties/functions can be accessed through the vector3 class, which also contains a vector3() constructor.
- dt and datetime types have been combined together as the time type.
- random is now a class with a constructor that must be initialized before use. This allows you to seed the random number generator.
- Example usage: rand = random(); OR rand = random(1337);
- Spawning functions (e.g. spawnItem(), spawnAnimal(), spawnVehicle()) have been moved to the spawner type.
- Example usage: spawner.spawnAnimal(2, vector3(10, 15, 10), 90)
- inVehicle property for player type renamed to isInVehicle.
- few events names have been changed for better organization.
- on####Barricade is now onBarricade####. (e.g. onBuildBarricade is now onBarricadeBuild)
- on####Structure is now onStructure####. (e.g. onDestroyStructure is now onStructureDestroy)
- OnPlayerEnterVehicle is now onVehicleEnter.
- OnPlayerLeaveVehicle is now onVehicleExit.
- A few events have updated signatures (new arguments).
- onBarricadeDestroy/onStructureDestroy no longer have a damage argument. You should use onBarricadeDamaged/onStructureDamaged instead.
- The onPlayerDeath event has been changed to onPlayerDeath(victim, killer, cause).
- Note: killer is no longer the id of the killer (murdererId) but either a player type or null (if not a player).
- Removed Barricade hasDoor(), hasSign() and hasStorage() functions. Use itemType property instead.
- Note: For the above functions, the corresponding types would be DOOR, SIGN, and STORAGE. There are many more types though, such as BED, LADDER, and SENTRY.
- Example usage: if(myBarricade.itemType == "SIGN")
- Barricade functions getSign(), getStorage(), and getDoor() replaced for sign, storage, and door properties.
- Reimplemented wait.seconds(). Note that the format is slightly different from before.
- Example usage: wait.seconds(5, broadcast, "Hello world!", "white");
- Marker functions for the player type has been moved to its own subtype and can be accessed through player.marker.
- Example usage: player.marker.set(vector3(10, 15, 20), "Example Marker")
- Another example: player.marker.position = player.position
- t is now recommended to use [] instead of array() for arrays (the latter is still supported).
- Example usage: myArray = array(1, 2, 3); should be written as myArray = [1, 2, 3];
Ster • Message Link
- Added map class for storing key-value pairs.
- Note: Map has a constructor, so to create a map you can do something like: myMap = map();
- Note: When enumerating (e.g. foreach loop), the item will be a keyValuePair type.
- Added onSignModify event.
- Added onVehicleDamaged event.
- Added playerSteamProfile class and player.steamProfile property.
- Added barricade property to the door, sign, and storage classes.
- Added dateTime.toString(format) function for custom date/time formats.
- Note: Default format is "yyyy-MM-dd HH:mm:ss".
- For more information visit https://www.c-sharpcorner.com/blogs/date-and-time-format-in-c-sharp-programming1
- Fixed player.teleport(x, y, z) function.
- Fixed vehicle.popTires() function to support more than 4 wheels and properly raise tire event.
Ster • Message Link
- Added vehicle.maxFuel property
- Changed playerClothing properties to return an item type instead of a uInt16
- Fixed vehicle.fuel property
- Fixed player.nearestLocation property
Ster • Message Link
- Added onPlayerExperienceUpdated event
- Added player.gesture property
- Fixed player.ip property
- Fixed player.arrested property
- Fixed server.ip property
Ster • Message Link