137 files

  1. [3D] Client-side Sound API.

    Description:
    This resources provides the ability to create/control sound in 3D via custom API. Also demonstrates the ability to use custom urls (Radio streams, local mp3 files). 3D sound should be synced automatically without the need of extra work. If you're looking for Frontend sounds then it should be easy to implement. If many demanded 2D sounds for this resource, i'll add it later.
    API:
    // Client-side // FUNCTIONS mp.game.audio.playSound3D(url, pos, volume, range, dimension) /* * url: string (Required) [Links and local package:// protocol are supported] * pos: vector3 (Required) * volume: int (Optional, Default: 1) [Range: 0 to 1] * range: int (Optional, Default: 60) [Max Range: 60] * dimension: (Optional, Default: 0) * Returns Object. * Object Properties: - id (sound's ID) - url (sound's url) - pos (sound's position) - volume (sound's volume) - range (sound's max range) - dimension (sound's dimension) - listeners (players array that are listening to the sound) - paused (If sound is paused) */ mp.game.audio.setSoundVolume(id, volume); /* * id (Sound's ID) * volume (sound's volume) Range (0.1 - 1) */ mp.game.audio.setSoundPosition(id, pos); /* * Useful for portable sound * id (Sound's ID) * pos (sound's new position) */ mp.game.audio.setSoundRange(id, range); /* * id (Sound's ID) * range (Max Range 60) (Increase it by editing the maxRange...) */ // EVENTS: /* * EventName: audioFinish * params: soundID (Sound's ID that is finished Playing) */ /* * EventName: audioError * params: soundID (Sound's ID that had error), errorObject {code: 'error code', error: 'error description'} */ // Example let sound = mp.game.audio.playSound3D('http://rfcmedia.streamguys1.com/MusicPulse.mp3', pos, 60, 1, 0); sound.destroy(); // Destroys the sound sound.pause(); // Pauses the sound sound.resume(); // Resumes the sound If you have any issues or suggestions, you know the usual routine.
    Credits:
    - Thanks to George for his 3D voice method.
    - Thanks to soundManager 2 for bringing music to life in CEF
    I wish you'll enjoy some epic music.

    92 downloads

       (2 reviews)

    0 comments

    Submitted

  2. [C#] Custom Timer - Server & Client

    With this script you can easily create custom timer.
    The file is fully commented and should be easy to understand.
    The file in Shared is required - and then use either the file in Server or in Client depending on where you are using it.
    You have to use the constructor to create the timer.

    Examples:
    Examples: // Yes, the method can be private // private void testTimerFunc(Client player, string text) { NAPI.Chat.SendChatMessageToPlayer(player, "[TIMER] " + text); } void testTimerFunc() { NAPI.Chat.SendChatMessageToAll("[TIMER2] Hello"); } [Command("ttimer")] public void timerTesting(Client player) { // Lamda for parameter // new Timer(() => testTimerFunc(player, "hi"), 1000, 1); // Normal without parameters // new Timer(testTimerFunc, 1000, 1); // Without existing method // var timer = new Timer(() => { NAPI.Chat.SendChatMessageToPlayer(player, "[TIMER3] Bonus is da best"); }, 1000, 0); // Kill the timer // timer.Kill(); }  

    313 downloads

       (3 reviews)

    0 comments

    Updated

  3. [C#] Example/Wrapper for fetching world objects.

    Just an example/wrapper on how to properly use "GetClosestObjectOfType" and fetch data from an object.
    I've been using this in my server for a while now to make it easier to get XYZ and rotation of objects in bulk, instead of having to go through them in codewalker which can be a pain.
    Installation
    Move client_packages to your client_packages folder Move Serverside C#/GetWorldObjects.cs to your gamemode or script. Move objectLocations.json to your server root directory.  
    Usage
    The JSON file included in the zip contains the pacific bank vault door as an example object. Use the /getworldobjects or /gwo command to run through all the items in the JSON file and fetch the X, Y, Z and XYZ Rotation of the object.
    As of right now it'll simply log the object to your server console and continue to the next object in the list, you can extend this functionality by editing the "REMOTE_EVENT_OnWorldObjectFetched" method in GetWorldObjects.cs server-side script.
    JSON file object info
    public class ObjectLocation { // The model name to look for, you can fetch this from CodeWalker or RAGEMP objectdb for example. public string Model { get; set; } // The model that should replace the model at this location, optional. I personally used this to store in the database and then on server start it'd delete the world object and replace it with the object model specified here. public string ReplacementModel { get; set; } = ""; // A position within X distance of the object you want to get the data of, distance can be specified by the Radius. public Vector3 Position { get; set; } // An optional type you can pass to the method so you can use it later on for data storage purposes(eg keep objects of certain types separated by an ID) public int Type { get; set; } = 0; // The radius to find the object, doesn't have to be too precise altho I generally recommend putting the player's teleport coordinates as close to the object as possible and decreasing range to 5 or 10. public int Radius { get; set; } } [ { "Model": "v_ilev_bk_vaultdoor", "ReplacementModel": "v_ilev_bk_vaultdoor", "Type": 0, "Radius": 25, "Position": { "X": 254.2859, "Y": 225.3845, "Z": 101.8757 } }, { "Model": "another_object_model_name", "ReplacementModel": "another_object_model_name_to_replace", "Type": 0, "Radius": 10, "Position": { "X": 1234.567, "Y": 123.456, "Z": 12.345 } }, ... ] All you have to do is add more items to the JSON file and it'll run thru all of them.

    19 downloads

       (0 reviews)

    0 comments

    Updated

  4. [C#] Key API

    Key.Bind - This function binds the key.
    keycode - hexadecimal code of key. keydown/keyup - true trigges on keydown, false triggers on keyup (bool) handler - function-handler. public class KeyTest: RAGE.Events.Script { public KeyTest() { Key.Bind(Keys.VK_ESCAPE, true, () => { // Code here return 1; }); } } To bind multiple keys:
    Key.Bind(new Keys[] { Keys.VK_T, Keys.VK_F6 }, true, ...)
    Key.IsUp - Returns true if the key specified has been released. Otherwise, returns false.
    keycode - code of the key (Keys.VK_T or 0x54) private void Tick(List<Events.TickNametagData> nametags) { if(Key.IsUp(0x62)) { // NUMPAD2 up } } Key.IsDown - Returns true if the key specified is pressed. Otherwise, returns false.
    keycode - code of the key private void Tick(List<Events.TickNametagData> nametags) { if(Key.IsDown(new int[] { 0x60, 0x61 })) { // NUMPAD0 & NUMPAD1 pressed. } }  

    80 downloads

       (1 review)

    0 comments

    Submitted

  5. [C#] Keys Bind for C#

    This function helps you to add keys binding if you use C # client side ...
    Example of use :
    Tick Event
    KeyManager.KeyBind(0xA2, () => { Chat.Output("Key Bind Work"); }); KeyManager.KeyBind(KeyManager.KeyMouse, () => { Cursor.Visible = !Cursor.Visible; });  
     

    387 downloads

       (1 review)

    2 comments

    Updated

  6. [C#] Screen FX Preview

    What it does: https://streamable.com/pht3r
    How to use:
    - requires c# on clientside
    - trigger clientside event from server
    For example:
    Add a server command and trigger this clientside script like this:
    NAPI.ClientEvent.TriggerClientEvent(client, "EnableScreenFx");
    Navigate through all the effects with left and right arrow keys - you'll get a local chat message with the current name of the effect and the index.
    Previous fx: LeftArrow
    Next fx: RightArrow

    104 downloads

       (1 review)

    0 comments

    Submitted

  7. [C#] Send Mail from server.

    Send mails from the server simple and easy.
    Ex:

    To work, you need to enable IMAP Access

     
    *This code was only tested on the GMAIL service
     

    81 downloads

       (1 review)

    0 comments

    Submitted

  8. [DEPRECATED] Vehicle Indicators

    Vehicle indicators are the main thing in role-play. Without it you can't role-play while driving or you can cause accidents.
    So i did that simple resource to give some help to the community
    Keys:
    Press X for Warning Lights Press left_arrow for Left indicator Press right_arrow for Right Indicator  
    Use root's resource for synced indicators
     

    660 downloads

       (3 reviews)

    1 comment

    Updated

  9. [JS, CEF] Internet Radio

    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

    150 downloads

       (2 reviews)

    0 comments

    Updated

  10. [JS,CEF] Emergency Alert System

    (EN) This script allow you to play emergency alert sound (2 sounds: tornado siren, alert siren), coming soon: amber alert with sound&pop-up
    (FR) Ce script vous permet de déclencher des sirènes d'alertes (sirène tornade, sirène d'alerte), à venir: alerte enlèvement avec son&popup
    ----- HOW TO INSTALL -----
    1) Unpack RAGEMP Alert v0.1
    2) Drop the content of "client_packages" folder inside your client folder
    3) Drop the content of "packages" folder inside your server folder
    4) Add in your server index.js :
    require('./Alert/sAlert');
    5) Add in your client index.js :
    require('./Alert/cAlert');
    6) Do not forget to change link of mp.browsers.new in Alert/cAlert.js if needed

    ----- HOW TO USE -----
    /alert tornado {repeat time}
    --> {repeat time} FROM 1 TO 9 TIMES
    Duration: EACH time: 9sec (min: 9sec, max: 81sec)
    /alert siren {repeat time}
    --> {repeat time} FROM 1 TO 9
    Duration: START: 5sec / ACTIVE: 12sec (repeat from 1 to 9) / END: 13sec (min: 30sec, max: 126sec)
    /alert siren stop
    --> stop the siren immediatly if activated (duration: 13sec)
    ----- DEMO -----
    Tornado Siren:
    Alert siren:
    Amber alert (coming soon):
     

    157 downloads

       (1 review)

    0 comments

    Updated

  11. [JS] [Server-Side] Control Actions

    Hey.

    You can simple disable/enable a control actions for the player on the server-side.
    It can be useful if you want disable/enable some keys like pause menu in game on the server-side.

    99 downloads

       (1 review)

    0 comments

    Submitted

  12. [JS] Basic Clothes Menu

    Simple cloth menu, you can open it by pressing F2.
    This script requires NativeUI library, download it from the resources tab.
    It's my first resource, do not expect too much.
    https://github.com/Snakewiz/ClothesMenu

    514 downloads

       (2 reviews)

    0 comments

    Submitted

  13. [JS] Client-side Door Control System

    Now you can lock or unlock doors and gates (from GTA V world).
    How to do that? Just press E.
    If you appreciate my work, you can press the like button. ❤️

    779 downloads

       (3 reviews)

    0 comments

    Updated

  14. [JS] Regional Restrictions

    Simple solution to check incoming connections from unwanted countries.
    I. Install geoip-Lite: npm i geoip-lite
    II. Edit country_ban list with the specified country codes https://dev.maxmind.com/geoip/legacy/codes/iso3166/
    III. Save and put this script to "server-files\packages" and add require('./countryBan');  in index.js

    35 downloads

       (1 review)

    0 comments

    Submitted

       (4 reviews)

    0 comments

    Submitted

  15. [JS] Vehicleseat Menu

    This is a Vehicleseat Menu in JavaScript for Rage:MP
     
    Install:
     
    Unzip vehicleseatJS.zip in your root server folder.
     
    Use:
     
    Press "F" or "G" when a Vehicle nearby you.
     
    Contact:
     
    You can Contact me on Discord for Questions.
     
    {Brace}#0571
     
    Have fun!

    479 downloads

       (0 reviews)

    2 comments

    Updated

  16. [Perfect for RP Servers]

    What is this amazing script?
    You are also able to control the steering (unable to set straight afterwards due to setSteeringAngle not being implemented yet) so you can move the vehicle to the side of the road.
    If you are an RP server then this is perfect for you!
    With some wizard maths, the text and position is at the correct end of each car and is based on distance (This has taken over 6 hours to get right). 
     
    Configuration
    I have already built in configuration to set whether you can allow it on locked vehicles, low health vehicles, whether the engine is off and certain vehicle classes.
    These can all be configured in the config section of the file:
    this.config = {            AllowVehicleClass: [0, 1, 2, 3, 4, 5, 6, 9, 18], // These are the normal vehicles in the game classes - to disable it, set it to false            MaxVehicleCubedSize: 25, // This is the vehicle length * width - as an idea an ambulance is 21            LockHandbrakeProtection: false, // If set - you can't push a locked vehicle (Theft prevention or ditching cars)            EngineProtection: false, // If set - you can only push if the enginer is turned off            VehicleHealthProtection: false, // Must be less than 1000 or false which de-activates checking vehicle health            PushEventName: false, // Set this to send an event to your server with the relevant Vehicle and Player attached (ie 'pushing_car')            LabelsDisplayed: true, // Show labels near the pushing positions when close enough            DebugPositions: false, // View pushing positions as markers so they are more visible            AllowVehicleSteering: true, // Allows the player to turn the wheels of the vehicle using A and D keys }  
    In Action
    To see how it looks working just checkout:
    https://streamable.com/ab2v5
     
    Questions
    Lastly if you have any questions feel free to give me a shout on discord (wdoyle2) or respond in the comment section.
    This is currently not on github but more than happy to post it for any future pull requests. 

     

    155 downloads

       (6 reviews)

    0 comments

    Updated

  17. [SCALEFORM] Chat

    This resource introduces the known chat scaleform from GTA:O. This chat supports (TEAM, LOCAL, GLOBAL) chats.
    CONTROLS:
    T (GLOBAL chat) Y (TEAM chat) U (LOCAL chat) PAGE_UP (Scroll history up) works only when input is opened PAGE_DOWN (Scroll history down)  works only when input is opened Known Issues:
    Message colors aren't supported due to scaleform Other languages than ENGLISH isn't supported (Might be supported in future)  
    API:
    Client-side API
    // Client side // Property getter/setter Boolean (Disables/Enables chat input) mp.gui.chat.disabledInput = true; mp.gui.chat.disabledInput // Property getter Boolean (Check if chat is open) mp.gui.chat.enabled; // Function to clear localPlayer's chat feed mp.gui.chat.clear(); // Trigger chat's visibility (visible: Boolean); mp.gui.chat.visible(visible); /* * msg: string * scope: string (message's scope (Author [scope] msg)) * author: string (Default: [SERVER]) * authorColor: int hudColorID (https://wiki.rage.mp/index.php?title=Fonts_and_Colors) (Default: white) */ mp.gui.chat.sendMessage(msg, scope, author, authorColor); /* * Registers command locally for client. * name: string (command name) * arg1: command's arguement */ mp.gui.chat.addCommand(name, function (arg1, arg2) { // do whatever... }); /* * Removes command locally for client. * name: string (command name) */ mp.gui.chat.removeCommand(name); Server-side API
    /* * Sends message to all players in server * msg: string * scope: string (message's scope (Author [scope] msg)) * author: string (Default: [SERVER]) * authorColor: int hudColorID (https://wiki.rage.mp/index.php?title=Fonts_and_Colors) (Default: white) */ mp.players.announce(msg, scope, author, authorColor); /* * Sends messaage to all players in specified dimension * dimension: int * msg: string * scope: string (message's scope (Author [scope] msg)) * author: string (Default: [SERVER]) * authorColor: int hudColorID (https://wiki.rage.mp/index.php?title=Fonts_and_Colors) (Default: white) */ mp.players.announceInDimension(dimension, msg, scope, author, authorColor); /* * Sends messaage to all players in specified dimension * position: Vector3 * range: int * msg: string * scope: string (message's scope (Author [scope] msg)) * author: string (Default: [SERVER]) * authorColor: int hudColorID (https://wiki.rage.mp/index.php?title=Fonts_and_Colors) (Default: white) */ mp.players.announceInRange(position, range, msg, scope, author, authorColor); /* * Registers commands in chat * name: string (command name) * player: command executer * arg1: Arguement after command */ mp.events.addChatCommand(name, function (player, arg1, arg2) { // Do what you want... }); /* * Removes command from server * name: string (command name) */ mp.events.removeChatCommand(name); /* * Sends message to all players in server * msg: string * scope: string (message's scope (Author [scope] msg)) * author: string (Default: [SERVER]) * authorColor: int hudColorID (https://wiki.rage.mp/index.php?title=Fonts_and_Colors) (Default: white) */ player.sendChatMessage(msg, scope, author, authorColor); // Clears player's chat player.clearChat(); Teams resource is supported.
    If you have any issues don't hesitate to contact me on Discord/Forums DM. 
    You're not allowed to redistribute this resource without my permission.
     

    274 downloads

       (8 reviews)

    0 comments

    Updated

  18. [v0.3.5] Implementing Custom NameTags

    Hi everyone!
    In need of a custom script for a Custom NameTag, I found the @hartority script, however, it was an outdated project and it had been made for version 0.2 of RageMP, with some references already removed, well, I bring you today the corrected code.
    Requirements:
    RageMP server files. Nothing more! Just have fun.   Introduction: This script is a reliable edition of the one produced by @hartority with only a few references to the RageMP library, so all code is credit @hartority.   Let's start:   1. Go to "client_packages" folder in "RAGEMP/server-files" directory, usually:   2. Create a JavaScript archive (.js) named "customtag.js", example:

      3. Inside the "customtag.js" paste this code:
      4. Save "customtag.js" file, and open "index.js" in "C:\RAGEMP\server-files\client_packages" directory and put this:
    End! Just test it and tell me if something goes wrong
    Usage example:

     
    The original code topic of @hartority:
    Thanks for all feedbacks,
    mad
    thanks @hartority for your commitment
    if you do not authorize this topic, please let me know

    285 downloads

       (1 review)

    1 comment

    Updated

  19. 2D Text Edtior

    This script will allow you to quickly and easily work with 2D text in the game.
    Contributions:
    rootcause
    Captien
    micaww
     
    In 1.0.5 update Scale-X and Outline of 2D text doesn't work and idk where's problem, because i can't fix it...

    247 downloads

       (3 reviews)

    2 comments

    Updated

  20. Animation Viewer

    Hi everyone,
    I've decided to share my Animator resource which basically lets you play all animations avaliable in this list:
    https://wiki.gtanet.work/index.php?title=Animations
    I have converted it from GTA Network to RAGEMP recently. It's a very simple but useful script. Searching through the animations list is like looking for needle in the haystack, considering about 2/5 of all anims cannot be applied to ped and 1/2 of those you wouldn't really find use for. It's a great solution if you don't want to install any mods to view anims. Just include the file and preview! Save included.
    There are 12,365 animations to play. Some of anims do not work on player as they are intended to be used on props, vehicles, weapons etc.
    You can also experience a few seconds delay on some animations, but none of them causes crashes.
    After launching the Animator a drawText will appear in bottom-right corner of the screen, showing you which animation you are viewing including ID, animation group and name.
     
    How to install:
    UnZip the file and move the animation-viewer folder to bridge -> resources folder. Include animation-viewer resource in settings.xml. Move animator.js from animation-viewer folder to clientside_packages folder and include it in index.js.  
    How to use:
    Type /animator to launch or close the animator. Type /animator help for in-game help. Type /animator skip [number] to skip to animation id. Type /animator save [savename] to save the animation. ( saves in server root folder in Saved_Animations.txt. ) Type /animator stop to stop currently playing animation. Use LEFT and RIGHT arrow keys to cycle through animations. Use UP and DOWN arrow keys to cycle through 100 animations at once.  
    Notes:
    All animations are looped. Clientside file is minified. This resource is made for server developers. It sends huge amounts of data to clientside when launching so use it only to preview/save animations. You can see the code here: https://gitlab.com/Hazes/animator-viewer  
    Changelog:
    [v1.0]
    Code has been sorted and is a bit more optimized. Fixed assembly reference error for those who didn't have System.IO.dll included in their main resource. Parsing the number in /animator skip now works correctly.  
    Presentation:
     

    740 downloads

       (3 reviews)

    3 comments

    Updated

  21. AnimPlayer

    Hi. To begin with, excuse me for my English.
    I share my resource for playing the animation.
    You can find animation on request.
    I wrote it primarily for myself, do not blame me for nothing. Сan anyone need.
    My resource is like Animation Viewer by Hazes but use another base and written in pure js.
    How to install:
    UnZip the file in  server-files. How to use:
    Use ~ or /animplayer to browse gui. /animplayer [request] for find animations coinciding with request. /animplayer  [dist / dist+name] for find animation with id = dist and type = name. /animflag [up/down/number] increase, decrease, or set the flag for animation Use LEFT/RIGHT arrow keys to cycle through (dist) animations. Use CTRL + LEFT/RIGHT arrow keys to cycle through (dist) 100 animations at once. Use SHIFT + LEFT/RIGHT arrow keys to cycle through (dist) 10 animations at once. Use UP/DOWN arrow keys to cycle (name) animations. Use CTRL + UP/DOWN for  increase or decrease flag. Use BACKSPACE to reset the search list. Use SPACE to play animation if you change parameter AnimPlayer.autoPlay in resource GitHub: https://github.com/TurEduard/rage.mp-animplayer

    585 downloads

       (3 reviews)

    2 comments

    Updated

  22. AwardAPI

    This script lets you create awards/achievements and give them to players.
     
    Installing
    Put the files you downloaded in their respective places Add require('awards') to client_packages/index.js Open packages/awards/database.js and put your MySQL config All done  
    API - Exported
    You need to load awards/api.js in your script with using require() for these.
    /* awardDefinitions object contains all defined awards. Keys of this object are valid award IDs. */ awardDefinitions /* Defines an award. Awards can be single or multi tier depending on what you send to requiredProgress. If you send an array of numbers, it will be a multi tier award. (then tierColor must be an array of numbers too, tierColors length being the same as equiredProgress length) If you send a single number, it will be a single tier award. (then tierColor must be a single number too) Check out https://wiki.rage.mp/index.php?title=Fonts_and_Colors#HUD_Colors for tierColors values. (107, 108, 109, 110 are great) You can search for mpawards in OpenIV/CodeWalker Explorer for txdLib and txdName, or send an empty string to txdLib and txdName if you don't want to use an icon. This function returns true if award is created, false otherwise. */ defineAward(ID, name, description, txdLib, txdName, requiredProgress, tierColor) /* Returns the specified award's tier for the specified progress. You must increase the return value by 1 if you want to display it to players. Returns: -2 if award ID is invalid -1 if progress isn't enough for any tier 0 and above if progress is enough for any tier */ calculateAwardTier(awardID, progress) /* Returns the specified award's icon color for the specified tier. Return value will be -1 if award ID is invalid. */ getAwardTierColor(awardID, tier)  
    API - Player
    /* This property contains the award data and should be used for getting values. Keys of this object are the award IDs that player has any progress on. player.awardData[validAwardID] properties: - Progress (number) - Tier (number) - IsComplete (boolean) - CompletionDate (date, null if award isn't complete) */ player.awardData /* Sets the specified award's progress to the specified amount. Returns false if awardID is invalid, true otherwise. */ player.setAwardProgress(awardID, progress) /* Changes the specified award's progress by the specified amount. Returns false if awardID is invalid, true otherwise. */ player.changeAwardProgress(awardID, progress) /* Resets the specified award's progress. Returns false if awardID is invalid or player doesn't have any data about the specified awardID, true otherwise. */ player.resetAwardProgress(awardID) /* Resets all award progress. Doesn't return anything. */ player.resetAllAwardProgress() /* Saves award data. You don't need to add this to your script's playerQuit event because AwardAPI will save data when a player disconnects. */ player.saveAwards()  
    Serverside Events
    /* playerAwardTierChange This event is called when a player's award's tier changes. */ mp.events.add("playerAwardTierChange", (player, awardID, oldTier, newTier) => { // code }); /* playerCompleteAward This event is called when a player completes an award. */ mp.events.add("playerCompleteAward", (player, awardID) => { // code });  
    Example
    This script creates 2 awards (one single tier and one multi tier), progresses them when certain events happen, sends a message to players when one of their awards has a tier change or completion and provides some commands.
    const awardAPI = require("../awards/api"); /* Multi tier award, will be complete when a player dies 1000 times. 1 deaths - tier 1 (bronze) 10 deaths - tier 2 (silver) 100 deaths - tier 3 (gold) 1000 deaths - tier 4 (platinum) */ awardAPI.defineAward("award_unlucky", "Unlucky", "You keep dying, be careful!", "mpawards5", "killmeleeweapons", [1, 10, 100, 1000], [107, 108, 109, 110]); /* Single tier award, will be complete when a player writes something to the chat. */ awardAPI.defineAward("award_chat", "Baby's First Words", "You used the chat.", "", "", 1, 110); // Events mp.events.add({ // Increase player's "award_unlucky" progress by 1 when a player dies. "playerDeath": (player) => { player.changeAwardProgress("award_unlucky", 1); }, // Set player's "award_chat" progress to 1 (since its max. progress is 1) when a player writes something to chat. "playerChat": (player) => { player.setAwardProgress("award_chat", 1); } }); // Commands mp.events.addCommand("howunlucky", (player) => { // example: check if player has any progress for award_unlucky, display a message based on completion if (player.awardData["award_unlucky"]) { if (player.awardData["award_unlucky"].IsComplete) { player.outputChatBox("You're extremely unlucky."); } else { player.outputChatBox(`Not too unlucky, just ${player.awardData["award_unlucky"].Progress} deaths...`); } } else { player.outputChatBox("You're pretty lucky for now."); } }); mp.events.addCommand("setawardprogress", (player, _, awardID, progress) => { // example: "/setawardprogress award_unlucky 1000" will complete "unlucky" achievement player.setAwardProgress(awardID, Number(progress)); }); mp.events.addCommand("changeawardprogress", (player, _, awardID, progress) => { // example: "/changeawardprogress award_unlucky 5" will add 5 progress to "unlucky" achievement player.changeAwardProgress(awardID, Number(progress)); });  

    132 downloads

       (2 reviews)

    0 comments

    Updated

  23. BanAPI

    Ban system that supports temporarily/permanently banning names, social club names, IP addresses and HWIDs.
     
    Installing
    Put banapi into your server's packages directory Open banapi/database.js and put your MySQL config All done  
    API
    /* getUnixTimestamp() Returns the current Unix timestamp. */ mp.bans.getUnixTimestamp() /* formatUnixTimestamp(unixTimestamp) Converts a Unix timestamp to "day/month/year hour:minute:second" format. Returns a string. */ mp.bans.formatUnixTimestamp(unixTimestamp) /* add(value, banType, reason, endUnixTimestamp) Adds a ban to the bans table, the ban will be permanent if endUnixTimestamp is -1. You need to provide the value like a player's serial, IP or name. endUnixTimestamp must be seconds, NOT milliseconds. Just use the provided getUnixTimestamp() This won't terminate the banned player's connection. Can be used for offline banning. Returns a promise. */ mp.bans.add(value, banType, reason, endUnixTimestamp) /* banPlayer(playerID, banType, reason, endUnixTimestamp) Bans the specified player, the ban will be permanent if endUnixTimestamp is -1. The script will get the value, you just need to provide a player ID and ban type. endUnixTimestamp must be seconds, NOT milliseconds. Just use the provided getUnixTimestamp() This will terminate the banned player's connection. Returns a promise. */ mp.bans.banPlayer(playerID, banType, reason, endUnixTimestamp) /* getInfo(banID) Gets information about the specified ban ID. Returns a promise. */ mp.bans.getInfo(banID) /* remove(banID) Removes the specified ban ID from the bans table. Returns a promise. */ mp.bans.remove(banID)  
    Ban Types
    0 = Name ban, player's current name will be banned. (player.name property) 1 = Social Club name ban, player's current social club name will be banned. (player.socialClub property) 2 = IP ban, player's current IP address will be banned. (player.ip property) 3 = HWID ban, player's current HWID will be banned. (player.serial property)  
    Example Commands
    /* Usage: /ban 5 0 60 Take a break Will nameban the player ID 5 (if there is a player with ID 5) for 60 minutes with the reason "Take a break". */ mp.events.addCommand("ban", (player, _, target, type, minutes, ...reason) => { target = Number(target); type = Number(type); minutes = Number(minutes); let fullReason = reason.join(' '); let targetPlayer = mp.players.at(target); if (targetPlayer) { mp.bans.banPlayer(targetPlayer.id, type, fullReason, mp.bans.getUnixTimestamp() + (minutes * 60)).then((banID) => { player.outputChatBox(`Banned ${targetPlayer.name} with the reason '${fullReason}' for ${minutes} minutes.`); console.log(`${player.name} banned ${targetPlayer.name} for ${minutes} minutes. (${fullReason}) BanID: ${banID}`); }).catch((err) => { player.outputChatBox(`Error occurred while banning ${targetPlayer.name}.`); player.outputChatBox(`Error: ${err.message}`); }); } else { player.outputChatBox(`No player with the ID ${target} found.`); } }); /* Usage: /baninfo 3 Will show information about ban ID 3 (if it exists) */ mp.events.addCommand("baninfo", (player, banID) => { banID = Number(banID); mp.bans.getInfo(banID).then((banInfo) => { if (banInfo) { player.outputChatBox(`Ban Information (BanID ${banInfo.ID})`); player.outputChatBox(`Type: ${banInfo.Type}`); player.outputChatBox(`Value: ${banInfo.Value}`); player.outputChatBox(`Reason: ${banInfo.Reason}`); player.outputChatBox(`Is Permanent: ${banInfo.LiftTimestamp == -1}`); if (banInfo.LiftTimestamp > -1) player.outputChatBox(`Ends: ${mp.bans.formatUnixTimestamp(banInfo.LiftTimestamp)}`); } else { player.outputChatBox(`BanID ${banID} expired or doesn't exist.`); } }).catch((err) => { player.outputChatBox(`Error occurred while getting BanID ${banID}.`); player.outputChatBox(`Error: ${err.message}`); }); }); /* Usage: /removeban 5 Will remove the ban with specified ID (if it exists) */ mp.events.addCommand("removeban", (player, banID) => { banID = Number(banID); mp.bans.remove(banID).then((success) => { if (success) { player.outputChatBox(`BanID ${banID} is now history...`); } else { player.outputChatBox(`Couldn't remove BanID ${banID}, probably expired or doesn't exist.`); } }).catch((err) => { player.outputChatBox(`Error occurred while removing BanID ${banID}.`); player.outputChatBox(`Error: ${err.message}`); }); });  
    Notes
    This script will handle banned players when they join. (kick if they're still banned, remove ban if their ban expired) Don't use JS timestamps as they are milliseconds, use the provided mp.bans.getUnixTimestamp()

    317 downloads

       (1 review)

    0 comments

    Submitted

  24. Basic Car Tuner

    Hey
    i made a simple Car Tuner for RageMP with NativeUI.
    You can open the menu with "F8".
    I have it on GitHub for you feel free to fork it:
    https://github.com/SupperCraft5000/Basic-Car-Tuner
    You can Tune not all Thins but the Basics.
     
     

    790 downloads

       (2 reviews)

    2 comments

    Updated