Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/01/20 in Files

  1. Version 1.0.0

    522 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
    3 points
  2. Version 1.0.0

    526 downloads

    In this file I will get you started on how you can use Discord to show your current player count. First step is to create an application at: https://discord.com/developers/applications Once created click Bot on the left hand side. Click "Add Bot" and then "Yes, do it!" Change your Icon to something more pretty Click "COPY" underneath "Click to reveal token" Open the file in the ZIP. Install PHP composer if not already installed. Run composer require team-reflex/discord-php Edit the example_rage.php file and change the "Discord Token here" to the token you copied earlier Change line 17 IP:PORT to your Server IP and Port When ready run the file with php -q example_rage.php This script must always be running for it to appear on the Discord member section. Therefore I would recommend running Linux Screen and running the php -q command then detaching the screen to run it in the background. The script uses the Discord Heartbeat to keep it active within the list. It will also only poll the server after running the heartbeat 5 times which is every 42 seconds. To set it up with your Discord server you must do the following: Take the link you were at to setup your bot - it should look like: https://discord.com/developers/applications/IDHERE/bot Where it says IDHERE - take it and insert it here: https://discord.com/api/oauth2/authorize?client_id=IDHERE&scope=bot&permissions=1 Once this page loads - select your discord server that you are an admin of. This will authorize your bot to submit to your server. To make your bot appear at the top of the list, simply create a new permission role called Server Give it permission to send messages Set it a nice colour Drag it to the top of your list Go to the User that is now in your Member list showing player details and give the role of the server you just created Have fun!
    1 point
  3. Version 1.0.0

    826 downloads

    This resource will help work with player clothes. I hope, someone will add all clothes screens to wiki πŸ˜€
    1 point
×
×
  • Create New...