Scripts
207 files
-
Levels
By rootcause
Installing
Put the files you downloaded in their respective places Add require('levels') to client_packages/index.js Open packages/levels/database.js and put your MySQL config All done
API
/* Player level and XP is accessed through currentLevel and currentXP shared data keys. You should not change the value of these shared data keys, just use them to get data and use the API to set data. */ player.data.currentLevel OR player.getVariable("currentLevel") // returns level of the player player.data.currentXP OR player.getVariable("currentXP") // returns XP of the player /* setLevel(newLevel) Sets the player's level to newLevel. (will also change player's XP to level XP) */ player.setLevel(newLevel) /* setXP(newXP) Sets the player's experience to newXP. (will update player's level) */ player.setXP(newXP) /* changeXP(xpAmount) Changes the player's experience by xpAmount. (will update player's level) */ player.changeXP(xpAmount) /* hasReachedMaxLevel() Returns whether the player has reached max level or not. */ player.hasReachedMaxLevel() /* saveLevelAndXP() Saves the player's level and XP data. Automatically called a player disconnects. */ player.saveLevelAndXP()
Events
These events are called on serverside when a player's level or XP changes.
/* playerXPChange This event is called when a player's XP changes. */ mp.events.add("playerXPChange", (player, oldXP, newXP, difference) => { // code }); /* playerLevelChange This event is called when a player's level changes. */ mp.events.add("playerLevelChange", (player, oldLevel, newLevel) => { // code });
Example Script
Here's a script that lets you change your level/XP and writes it to console:
mp.events.addCommand("setlevel", (player, newLevel) => { newLevel = Number(newLevel); if (!isNaN(newLevel)) { player.setLevel(newLevel); } else { player.outputChatBox("SYNTAX: /setlevel [new level]"); } }); mp.events.addCommand("changexp", (player, amount) => { amount = Number(amount); if (!isNaN(amount)) { player.changeXP(amount); } else { player.outputChatBox("SYNTAX: /changexp [amount]"); } }); mp.events.addCommand("setxp", (player, amount) => { amount = Number(amount); if (!isNaN(amount)) { player.setXP(amount); } else { player.outputChatBox("SYNTAX: /setxp [new xp amount]"); } }); mp.events.add("playerXPChange", (player, oldXP, newXP, difference) => { console.log(`${player.name} ${difference < 0 ? "lost" : "gained"} some XP. Old: ${oldXP} - New: ${newXP} - Difference: ${difference}`); }); mp.events.add("playerLevelChange", (player, oldLevel, newLevel) => { console.log(`${player.name} had a level change. Old: ${oldLevel} - New: ${newLevel}`); });
Credits
Unknown Modder - RP List IllusiveTea - Rank bar scaleform
Notes
This script will load and save level and XP data of players on its own but a function to save player data yourself is provided. Like said before, don't change the values of currentLevel and currentXP shared data keys. Maximum reachable level is 7999 but a player can earn XP until his rank bar is full, kinda reaching 8000. Use player.hasReachedMaxLevel() to detect if a player is level 7999 and his rank bar is full.
1017 downloads
(6 reviews)0 comments
Submitted
-
Inactive Car Despawner after Timer
This is written in NodeJS, and is only Server Side!
With this Script, all Vehicles, which are not moved are despawned after X minutes.
NOTE: Code and comments on english
Video (english explenation):
Installation:
Put the folder in your packages directory
424 downloads
(2 reviews)0 comments
Submitted
-
Player List
By rootcause
Requires RAGE Multiplayer 1.1.0 and above.
This resource adds a GTA Online like player list to your server.
Installing
Put playerlist into your server's client_packages directory, then add require('playerlist'); to client_packages/index.js.
Controls
Z = Toggle player list visibility.
PageUp = Move to the next page.
PageDown = Move to the previous page.
Customization
You have the ability to customize how a player is displayed in the list. Here's a list of shared variable keys used for customization:
PlayerListColor = This shared variable is used to specify which background color the player will have in the list. Uses an integer (HUD color ID), so go check the wiki.
PlayerListTag = This shared variable is used to give players a crew/clan tag next to their name in the list. Setting this value to more than 5 characters isn't recommended since the scaleform displays up to 5 characters. (deprecated in 2.0)
Crew Tag API (Serverside - v2.0 and above)
// Sets the crew tag of a player. // "tag" being empty will reset player's crew tag. // "tag" should not be more than 4 or 5 characters to prevent visual annoyances player.setCrewTag(tag, { crewIsPrivate, // Boolean - makes the crew tag background a rectangle if true, indicates player owned clans crewIsRockstar, // Boolean - adds the Rockstar Games logo to the crew tag display if true playerCrewRank, // Number - player's rank in their crew, refer to crew ranks list below, ignored if crewIsPrivate is false crewTagColor // Array of numbers (red, green, blue) - the crew color }); // Resets the crew tag of a player. player.resetCrewTag(); // Crew ranks Leader = 0 (100% crew color "strip" display) Commissioner = 1 (80% crew color "strip" display) Lieutenant = 2 (60% crew color "strip" display) Representative = 3 (40% crew color "strip" display) Muscle = 4 (20% crew color "strip" display) Member = 5 (no crew color "strip" display)
Various crew tags:
Credits
TomGrobbe - mp_mm_card_freemode scaleform research
@rgnbgnhnd @Jer - Testing
Notes
This script uses mp.gui.chat.show function to toggle chat visibility when a player opens/closes the player list. Meaning if you have a custom chat, this resource might fail to toggle chat visibility.
Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-playerlist
854 downloads
(6 reviews)0 comments
Updated
-
Simple Teams
By rootcause
Prevents players of the same team shooting eachother.
Installing
Put teams into your server's client_packages directory, then add require('teams'); to client_packages/index.js.
Using
It's pretty simple, just set currentTeam shared variable of a player like this:
// both strings and numbers should work playerEntity.data.currentTeam = whatever; playerEntity.setVariable("currentTeam", whatever); And set currentTeam to null if you want to reset someone's team.
Note
This resource doesn't prevent all kinds of friendly fire, for example projectile weapons like RPG can hurt teammates, you can still run teammates over with a vehicle etc. You can check if both killer and victim is on the same team and punish the killer, though.
549 downloads
(4 reviews)0 comments
Updated
-
AwardAPI
By rootcause
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)); });
277 downloads
(2 reviews)0 comments
Updated
-
Headshots
By rootcause
Small script that adds instantly killing headshots.
Installing
Put headshots into your server's client_packages directory, then add require('headshots'); to client_packages/index.js.
1137 downloads
(6 reviews)0 comments
Submitted
-
Character Previewer
By MarkCavalli
This resource will help work with player clothes. I hope, someone will add all clothes screens to wiki 😀
860 downloads
(2 reviews)0 comments
Updated
-
GTAO Suicide
By rootcause
This script adds the suicide feature of GTA Online.
You can commit suicide by using /suicide command. Your character will shoot itself if you're holding a pistol and take pills otherwise.
Installing
Put the files you downloaded in their respective places Add require('suicide') to client_packages/index.js All done506 downloads
(3 reviews)0 comments
Submitted
-
Moods
By rootcause
This resource lets players choose their mood. Selected mood is synced to other players.
Installing
Put the files you downloaded in their respective places Download & install NativeUI if you haven't yet, this script needs it Add require('moods') to client_packages/index.js All done Controls
F7 Key - Show/hide mood menu.
623 downloads
(5 reviews)0 comments
Updated
-
Global Voice Chat
By ragempdev
The most trivial example usage of the recently introduced built-in voice chat API: global chat. It connects you to all players when you join the server and vice-versa.
Press F4 to toggle local player's muted state.
As of 24th Oct 2018 you need to use "testing_voice" branch to utilize voice chat API.
897 downloads
(5 reviews)0 comments
Updated
-
Binoculars
The scenario used here is not synced
Use the command to trigger the script :
/binocular Scroll up and down to zoom in / out.
Installation: Just put the folders where they should be, don't forget to import client side scripts in your index.js
If you have any question feel free to ask us
By AdAstra Dev Team (FR :D)
457 downloads
(2 reviews)0 comments
Updated
-
Manual transmission
By Captien
Hello everyone,
It's been a while i didn't do some resources, and I've seen root taking the throne for a while. So i thought i would contribute again with some average resource for the developers to know more about rage's environment. Basically this resource introduces manual transmission to cars to ensure more control on your vehicle and to enjoy the experience of the manual transmission (Could be useful for some drag racing maybe..).
Anyways manual is toggled by the command: /manual
Controls:
NUMPAD_ADD increases the gear. NUMPAD_SUBTRACT lowers the gear Simple manual HUD was introduced beside the mini-map to know everything about your vehicle.
Gears: 1-5, N, R.
Shifting to fast disables vehicle engine. You have wait the shiftNow sign to appear, so you can shift to the next gear.
Any questions/bugs please notify me in the comments section.
Drive safely,
Keptin
674 downloads
(6 reviews)0 comments
Updated
-
Synced stream/dimension variables
By Captien
This resource introduces new types of synced data variables along with entity.setVariable and entity.setOwnVariable to lower the affected user with syncing such data to a certain scope.
Stream variables: Introduces synced data variables across streamed entities. The entity provides his data to the streamed clients and the vice versa. Dimensional variables: Introduces synced data variables across a dimension. The entity provides data to all clients in the dimension with a option to have a persistent data mode which keeps the data synced across multi dimension change. Note: Dimensional variables won't operate properly if you don't use its custom function entity.setDimension due to some complications that couldn't be sorted out.
More information about the API usage can be found in github repo.
This resource was a collaboration with me and @materiawith a vision to release a series of open sourced resources later on.
130 downloads
(2 reviews)0 comments
Submitted
-
Shooting Range
By GL1TCH1337
This script provides working(not perfect) shooting range. You can try it with /poligon command but if you want to add it to your server. You should edit it a bit.
Features
Random target spawn points.
Changing interval between targets.
20 - 45 targets left: 3000 ms 10 - 20 targets left: 2500 ms 0 - 10 targets left: 2000 ms Points based on hit area (not working perfect)
Script testing video
281 downloads
(6 reviews)0 comments
Updated
-
Client-side TowTruck States Event
By Tampa
OnPlayerTowTruckStateChange returns: attach - when any vehicle has been attached to tow truck detach - when attached vehicle has been detached from tow truck deadOrDestroy - when attached vehicle has been destroyed exit - when player exit tow truck while have got attached some vehicle
I think that's simple and useful for everyone.
586 downloads
(1 review)0 comments
Updated
-
Lucky wheel
By Idle
Lucky wheel is synced.
Coords: 1110.8710, 228.8737, -49.6358
resource on my github: https://github.com/Sokol123456/luckywheel
Added support for 0.3.7, check github
632 downloads
(1 review)0 comments
Updated
-
Hood Up
By rootcause
This resource adds the ability to hood up/down while wearing a hoodie.
Requirements
RAGE Multiplayer 1.1 and above
Installing
Put the files you downloaded in their respective places Add require('hood-up') to client_packages/index.js All done
Using
Press F5 while wearing a hoodie as mp_m_freemode_01 or mp_f_freemode_01.
How it works
This resource uses Rockstar's restriction tags and variant components to identify what the hood up/down drawable would be, meaning you don't need to hardcode any IDs. It also uses restriction tags to check if hooding up causes any clipping while wearing a hat/mask.
Tag(s) used to check if current top is hooded: HOODED_JACKET (top clothing item must not have HOOD_TUCKED tag - causes an issue with parkas)
Tag(s) used to check if current top's hood is down: HOOD_DOWN
Tag(s) used to check if current hat is compatible with hooding up: HOOD_HAT
Tag(s) used to check if current mask is compatible with hooding up: HOOD_COMPAT, REBREATHER, HAZ_MASK, SKI_MASK, GAS_MASK, BIKER_MASK (if mask clothing has one of these flags, you can hood up)
For more information, just check the code.
Notes
Some hats/masks prevent hooding up even though there wouldn't be any clipping - not much I can do, Rockstar set their restriction tags that way. Open parkas seem to get replaced with their closed variation upon hooding up. Tops with this issue are: 185, 189, 212, 303 on mp_m_freemode_01 and 187, 191, 216, 314 on mp_f_freemode_01 Serverside part of this resource accepts whatever value players send for their new top (there's still a basic bounds check), you might want to figure out a way to secure it. Also on GitHub: https://github.com/root-cause/ragemp-hood-up257 downloads
(4 reviews)0 comments
Submitted
-
Kill Counter
By rootcause
This resource adds the kill counter from GTA Online. Players will get a notification showing how many times they died to their killer (red) and how many times they killed their killer (blue) on death.
Requirements
RAGE Multiplayer 1.1 and above
Installing
Put the files you downloaded in their respective places Add require('killcount') to client_packages/index.js All done
API (Serverside)
This resource adds a function to the player object:
/** * Returns how many times this player killed the specified player. * @param {mp.Player} otherPlayer * @return {Number} */ player.getKillsAgainst(otherPlayer);
Notes
Kill counters are reset on disconnect Will probably cause mad trash talking Also on GitHub: https://github.com/root-cause/ragemp-kill-counter216 downloads
(4 reviews)0 comments
Submitted
-
Bigmap
By ufteers
Hello 👋 ragers 😡 😡 😡 have a good 👍 👍 day ☀️ ☀️ ☀️ ☀️
I would like to present C# & JS resource that lets allows you to switch between 3 map options. Like in GTA Online.
Default map. Zoomed out. Big map.
Installing & Using
Put the files you downloaded in their respective places Press Z (Default) (Settings — Key Bindings — General — Radar Zoom / Multiplayer information)702 downloads
(2 reviews)0 comments
Updated
-
[C#] Send Mail from server.
By CMHDev
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
202 downloads
(1 review)0 comments
Submitted
-
Colored Headlights
By rootcause
This script adds the colored xenon headlights feature from Arena War DLC.
Installing
Put coloredhlights into your server's client_packages directory, then add require('coloredhlights'); to client_packages/index.js.
Using
Set the headlightColor shared variable of a vehicle to the headlight color ID you want. Command example:
// /hcolor 10 should make your vehicle's headlights pink mp.events.addCommand("hcolor", (player, _, colorId) => { if (player.vehicle) { player.vehicle.data.headlightColor = Number(colorId); } else { player.outputChatBox("You're not in a vehicle!"); } });
Headlight Colors
Since Rockstar didn't make headlight colors RGB, you can only use a set of numbers as color IDs.
0 = White 1 = Blue 2 = Light Blue 3 = Green 4 = Light Green 5 = Light Yellow 6 = Yellow 7 = Orange 8 = Red 9 = Light Pink 10 = Pink 11 = Purple 12 = Light Purple Color IDs higher than 12 will force xenon headlights to use their default color.
Notes
Since this script toggles the xenon headlights mod (toggleMod 22), it may not work with your car customization script. Color IDs lower than 0 and color ID 255 will disable the feature (revert headlights back to normal from xenon) until you set a valid color again.1056 downloads
(7 reviews)0 comments
Submitted
-
[Real 3D] Server-side Sound API
By fakeskill
Description:
This resources provides the ability to create/control sound in 3D via custom API.
A slightly redesigned version of the Sound API, with real synced 3d effect.
API:
// Client-side mp.game.audio.playSound3D(veh_id, url, range, volume, track_length) /* * veh_id: int(Required) [Vehicle RemoteID] * url: string (Required) [Links and local package:// protocol are supported] * range: int (Optional, Default: 60) * volume: int (Optional, Default: 1) [Range: 0 to 1] * track_length: int (Optional, Default: 180) [Current track length in seconds] */ /// EVENTS: // (Client) /* * EventName: audioFinish * params: soundID (Vehicle's RemoteID that is finished Playing) */ /* * EventName: audioError * params: soundID (Vehicle's RemoteID that had error), errorObject {code: 'error code', error: 'error description'} */ // (Server) /* * EventName: sound:create * params: id, (Vehicle's RemoteID) url, range, volume, track_length */ /* * EventName: sound:destroy * params: id (Vehicle's RemoteID) */ /* * EventName: sound:pause * params: id (Vehicle's RemoteID) */ /* * EventName: sound:resume * params: id (Vehicle's RemoteID) */ /* * EventName: sound:setVolume * params: id (Vehicle's RemoteID), volume */ // Example let vehicleId = mp.players.local.vehicle.remoteId; mp.game.audio.playSound3D(vehicleId, 'http://rfcmedia.streamguys1.com/MusicPulse.mp3', 20, 1, 60); mp.events.callRemote('sound:pause', vehicleId); mp.events.callRemote('sound:resume', vehicleId); mp.events.callRemote('sound:destroy', vehicleId); If you have any issues or suggestions, you know the usual routine.
Credits:
- Thanks to Captien for his 3D sound API.
Media:
828 downloads
(4 reviews)0 comments
Updated
-
Attached Bike Sync
By Gibzon
Attach a player to bmx, cruiser or scorcher bike
optional downloads:
https://de.gta5-mods.com/vehicles/lowrider-bike-add-on-replace
https://de.gta5-mods.com/vehicles/forever-28-inches-bike-add-on-extras
Installing
extract attachedBike folders to packages/attachedBike and client_packages/attachedBike if you allready have a index.js in your client_packages: add "require('attachedBike')"
Usage
Press "G" - Attach/Unattach player to/from bike Spawn a Cruiser: /bike Spawn a Bmx: /bike bmx Spawn a Scorcher: /bike scorcher optional mod bikes:
/bike yj28 /bike lowriderb
Notes
GitHub: https://github.com/Yoegibby/ragemp-attachedBike
272 downloads
(3 reviews)0 comments
Updated
-
Player Scoreboard + Health & Armour
This is a Complete Script for Scoreboard.
add the file "client_packages" in main folder.
you can open / close the scoreboard with f10
made by CommanderDonkey & ByTropical
651 downloads
- Scoreboard
- Health
- (and 3 more)
(0 reviews)0 comments
Updated
-
Teamspeak Voice - Plugin Source and Script
By DevGrab
This is a fully functional source-code of a Teamspeak³ plugin and also the implementation into RAGE:MP.
All needed dependencies are included into the archive and are easy to use. Make sure when you open the project in Visual Studio to include the missing dependencies before compiling. The plugin currently only support's x64 building. Most users should use x64 bit which improves performance of the plugin and teamspeak anyways.
To include the plugin make sure you read all the needed stuff which is included into the server-side scripts and also make sure that you setup browser (cef) stuff correctly. Setting this plugin up needs a bit of knowledge but can also be done by a bit of effort.
The plugin has an included websocket which is transmitting data to the client-side RAGE:MP script and back, the client side which is creating a socket with javascript in cef then redirects the traffic to the client-side scripts and also back. A json string is generated at the client-side which is then send to the Teamspeak plugin and progress is being made by reading it and placing the users, mute them and block them.
I've removed encryption of the json since it's not needed for normal use and people cannot abuse it in a bad way (only listening to other players by abuse e.g sniffing or proxy the client-sided connection to RAGE).
This plugin was more like a proof-of-concept how it can be done without using other third-party non public resources.
Enjoy. Feel free to ask question on RAGE:MP Discord or DevGrab#0815. There is no pre-build version of it until someone is gonna release it.
630 downloads
(1 review)0 comments
Submitted
