Search the Community
Showing results for tags 'colshape'.
-
Version 1.0.0
512 downloads
I recently needed a polygons library like this for my gamemode to define some companies, houses, gangzones and other kind of establishments boundaries, so I decided to create this resource previously based on abmn's zone manager, but the code was terrible and I decided to rewrite my own from scratch and improving the functionality. Basically you'll be able to create any kind of colshape you want, without worring about combining colshapes to fit your needs, you can just define the points and the height of the shape and it'll be created easily! You can set boundaries for houses to move furnitures, for companies to accomplish the job, for mountains in hunting animals scripts and anything else your creativity takes you, just use it! Demos https://streamable.com/w7l4h6 https://youtu.be/OxSPcVQrWrY Advantages The main advantages of using this resource instead of abmn's are: These polygons are dynamic, you can modify, move, rotate, basically do anything to the polygon vertices array in real time and it'll work instantaneously, updating the collisions with players. This script is way more optimized and lightweight than the other version. You can choose the color for the lines of the polygon and set them visible or not by just modifying the polygon `visible` property. This script supports different kind of heights for detecting collision (eg.: slopes), it's accurate (may not work as you think it should depending on the slope degree and the polygon height), and supports even colshapes for mountains. You can add more vertex at any time you want to existing polygons, by just pushing a new vector3 position to `polygon.vertices` array. API Functions /* Creates a new polygon and return it's instance */ mp.polygons.add(vertices: Vector3Mp[], height: number, options = { visible: false, lineColorRGBA: [255,255,255,255], dimension: 0 }): Polygon /* Removes a polygon */ mp.polygons.remove(polygon: Polygon): void /* Check if a polygon exists */ mp.polygons.exists(polygon: Polygon): boolean /* Check if a position is contained within a given polygon */ mp.polygons.isPositionWithinPolygon(position: Vector3Mp, polygon: Polygon): boolean /* Examples */ // Creating a new polygon const polygon = mp.polygons.add([new mp.Vector3(10, 10, 5), new mp.Vector3(15, 15, 5), new mp.vector3(5, 5, 5)], 10, { visible: false, lineColorRGBA: [255,255,255,255], dimension: 0 }); // Set the polygon lines visible polygon.visible = true; // Modifying a polygon height polygon.height = 100; // Modifying a polygon color (RGBA) polygon.lineColorRGBA = [255, 155, 0, 255]; // Modifying a polygon dimension polygon.dimension = 30; /* Events*/ // Event called when player enter a polygon (clientside) mp.events.add('playerEnterPolygon', (polygon) => mp.gui.chat.push(`You entered the polygon ${polygon.id}!`)); // Event called when the local player leaves a polygon (clientside) mp.events.add('playerLeavePolygon', (polygon) => mp.gui.chat.push(`You left the polygon ${polygon.id}.`)); How to install Download the zip folder Extract it on your clientside folder Require the index file from the polygons folder. Enjoy it! See you on the next release! - n0minal -
Version 1.0.1
609 downloads
Internet radio over colshapes using CEF. Scope of application: custom clubs, interiors. Default location is the Galileo Observatory (behind the monument). Default radio station - Wacken Radio (DE). Installation: I. Put server files to: server-files\packages\yourGameMode II. Add require('./rStreamColshapes'); to your server's index.js III. Put client files to: client_packages then edit your client's index.js and add require('./rStream'); To change radio stream url, edit index.html here: client_packages\cef\rStream\index.html GitHub -
Colshape.position return undefined. Is there any ways to get position of colshape clientside. Colshape.getCoords(true/false) also return undefined
-
Hi How to check trailer ID when entering the colshape? I didn't find anything on WIKI
-
Hii, How do i properly access all colshapes serverside so i can access there attributes? I mean i could port the data to a db on create and work with sql😬..? or ad SetValue commands? Is there a true way? i tryed: 1. let colshapeMarkers = []; let colshapecolor = [133,30,62,200] let ChatColorR = "!{"+[255, 0, 0]+"}"; let ChatColorW = "!{"+[255, 255, 255]+"}"; let ServerChatM = '['+ChatColorR+'SERVER'+ChatColorW+'] '; mp.events.addCommand("setv", (player) => { //colshapeMarkers = null; //reseting let colshapesArr = mp.colshapes.toArray(); player.outputChatBox('['+ChatColorR+'SERVER'+ChatColorW+'] '+colshapesArr) colshapesArr.every((colshape) => { player.outputChatBox(ServerChatM+' id of colshape:'+colshape.id); marker = mp.markers.new(1, new mp.Vector3(colshape.x, colshape.y, colshape.z), colshape.range, { direction: new mp.Vector3(colshape.x, colshape.y, colshape.z), rotation: new mp.Vector3(0, 0, 0), color: [133,30,62,200], visible: true, dimension: player.dimension }); }); and: let colshapeMarkers = []; let colshapecolor = [133,30,62,200] let ChatColorR = "!{"+[255, 0, 0]+"}"; let ChatColorW = "!{"+[255, 255, 255]+"}"; let ServerChatM = '['+ChatColorR+'SERVER'+ChatColorW+'] '; mp.events.addCommand("setv", (player) => { //colshapeMarkers = null; //reseting // let colshapesArr = mp.colshapes.toArray(); // player.outputChatBox('['+ChatColorR+'SERVER'+ChatColorW+'] '+colshapesArr) // colshapesArr.every((colshape) => { // player.outputChatBox(ServerChatM+' id of colshape:'+colshape.id); // marker = mp.markers.new(1, new mp.Vector3(colshape.x, colshape.y, colshape.z), colshape.range, // { // direction: new mp.Vector3(colshape.x, colshape.y, colshape.z), // rotation: new mp.Vector3(0, 0, 0), // color: [133,30,62,200], // visible: true, // dimension: player.dimension // }); mp.colshapes.forEach((colshape) => { // Create Markers player.outputChatBox(ServerChatM +colshape.id) marker = mp.markers.new(1, new mp.Vector3(colshape.x, colshape.y, colshape.z), colshape.range, { direction: new mp.Vector3(colshape.x, colshape.y, colshape.z), rotation: new mp.Vector3(0, 0, 0), color: [133,30,62,200], visible: true, dimension: player.dimension }); colshapeMarkers[colshape.id] = marker.id; }); }); -> https://wiki.rage.mp/index.php?title=Pool::toArray