Scripts
207 files
-
[C#] Custom Timer - Server & Client
By Bonus
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(); }
713 downloads
(4 reviews)0 comments
Updated
-
Car Compare (0-100, 0-200, Vmax)
By MrGenzo
Copy folder to "client_packages" and add
require("./genzocarcompare"); to your "client_packages/index.js";
392 downloads
(1 review)0 comments
Submitted
-
GTA SA Classic Menu
By adri1
This is a CreateMenu for the illegal gta v emulator.
Usage example:
List<string[]> menuItems = new List<string[]>(); menuItems.Add(new string[] { "Item 1 Column 1", "Item 1 Column 2" }); menuItems.Add(new string[] { "Item 2 Column 1", "Item 2 Column 2" }); Menu menu = new Menu("Title", new string[] { "Header 1", "Header 2" }, menuItems).show(); menu.setOnMenuResponseListener((Menu.OnMenuResponseListener onMenuResponseListener) => { RAGE.Chat.Output("Response: " + onMenuResponseListener.response + " item: " + onMenuResponseListener.item); menu.destroy(); });
160 downloads
(7 reviews)0 comments
Submitted
-
Job Taxi
By Idle
Job Taxi:
1. Call taxi;
2. Set the route by coordinates;
3. Accept call;
4. Good system of money calculation;
5. Reasonableness of the main features.
922 downloads
(1 review)0 comments
Updated
-
Simple Chat Advert
By MorHo
Simple Chat Advert
basically it'll prints out whatever you want into to chat.
Please do not change the code edit just config.json
308 downloads
(0 reviews)0 comments
Updated
-
Metal Detectors
By rootcause
This resource lets you add metal detectors that go off when a player with a not allowed weapon goes through them.
Installing
Put the files you downloaded in their respective places Add require('metaldetectors') to client_packages/index.js Set up some metal detectors (read below) All done
JSON Files
Most of the changes are done by editing JSON files located in packages/metaldetectors/json/.
Remember to validate your changes here: https://jsonlint.com/
config.json
colshapeSize: Size of the metal detector colshape, I think the default value is pretty much perfect and doesn't need any editing.
soundRange: Maximum range/distance of the players who should hear metal detector alarms, default value is 15.0.
cooldownMs: Milliseconds that need to pass before a metal detector goes off again, default value is 2000.
allowedWeapons: Array of weapons that are ignored by metal detectors. This list is pretty much empty and you probably should fill it, WEAPON_UNARMED and WEAPON_CERAMICPISTOL are ignored by default.
smallWeaponGroups: Array of weapon groups that are considered small. Weapons of this group will play the small weapon alarm sound and everything else will play the big weapon alarm sound. GROUP_MELEE, GROUP_PISTOL, GROUP_SMG, GROUP_STUNGUN and GROUP_THROWN are considered small by default.
detectors.json
This file contains the metal detectors in array of objects format. A metal detector has x, y, z, heading, dimension and createProp properties.
x, y, z: Coordinates of the metal detector.
heading: Rotation (yaw) of the metal detector.
dimension: Dimension of the metal detector.
Default value: 0
createProp: Whether this metal detector should create a prop when it is loaded or not, useful if you want to use existing metal detectors. (like in the IAA facility interior)
Default value: true
// Example: Metal detector used in the making of video above { "x": 2059.037109375, "y": 2980.64208984375, "z": -62.90178298950195, "heading": 325.0, "dimension": 0 }
weaponData.json
Used for weapon groups, just make sure it is updated after every DLC.
For Developers
This resource triggers an event named playerTriggerMetalDetector with args player, position, isSmallWeapon when players trigger a metal detector.
player: The player who triggered a metal detector.
position: Coordinates of the metal detector.
isSmallWeapon: Whether the player's weapon was a small weapon or not.
(another arg that contains weapon hash might be added in the future)
Example
mp.events.add("playerTriggerMetalDetector", (player, position, isSmallWeapon) => { player.outputChatBox(`You triggered a metal detector with a ${isSmallWeapon ? "small" : "big"} weapon!`); });
Notes
Right now, this resource checks only the current weapon of a player due to issues with player.weapons. If player.weapons get fixed, I'll update the resource to check for all weapons of a player.
Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-metal-detectors
604 downloads
(6 reviews)0 comments
Updated
-
Simple Tablet
By XCRON
RAGEMP-SimpleTablet
This is a really basic tablet for your resource. You can open it, and it show your embedded link. Press O to open it.
Installation
Just add the files in client_packages to your resource & add the following code to your index.js
require("tablet/tablet.js"); How to change the embedded object
Go in the "tablet" folder and open "tablet.html" with your editor. Change the URL on line 14 & 15.
How to change the key to open it:
Go in the "tablet" folder and open "tablet.js" with your editor. Change the "0x4F" on line 3 to your key of choice.
Here you can find all key values:
https://docs.microsoft.com/de-de/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN
GITHUB: https://github.com/XCRON-DEV/RAGEMP-SimpleTablet
For questions or help DM me here.
1390 downloads
(2 reviews)0 comments
Updated
-
Scaleform Messages
By rootcause
This resource lets you display GTA V/Online styled shard messages.
Installing:
Put scaleform_messages into your server's client_packages directory, then add require('scaleform_messages/index.js'); to index.js.
Available events:
ShowMidsizedMessage // title, message, time = 5000 ShowMidsizedShardMessage // title, message, bgColor, useDarkerShard, condensed, time = 5000 ShowWeaponPurchasedMessage // title, weaponName, weaponHash, time = 5000 ShowPlaneMessage // title, planeName, planeHash, time = 5000 ShowShardMessage // title, message, titleColor, bgColor, time = 5000 Clientside example (will show different messages when you press numpad0 - numpad6):
mp.keys.bind(0x60, false, () => { mp.events.call("ShowMidsizedMessage", "Title", "ShowMidsizedMessage example"); // or: mp.game.ui.messages.showMidsized("Title", "ShowMidsizedMessage example"); }); mp.keys.bind(0x61, false, () => { mp.events.call("ShowMidsizedShardMessage", "Title", "ShowMidsizedShardMessage example", 21, false, false); // or: mp.game.ui.messages.showMidsizedShard("Title", "ShowMidsizedShardMessage example", 21, false, false); }); mp.keys.bind(0x62, false, () => { mp.events.call("ShowMidsizedShardMessage", "Title", "ShowMidsizedShardMessage example 2 (condensed = true)", 21, false, true); // or: mp.game.ui.messages.showMidsizedShard("Title", "ShowMidsizedShardMessage example 2 (condensed = true)", 21, false, true); }); mp.keys.bind(0x63, false, () => { mp.events.call("ShowWeaponPurchasedMessage", "Title", "ShowWeaponPurchasedMessage example", -2084633992); // or: mp.game.ui.messages.showWeaponPurchased("Title", "ShowWeaponPurchasedMessage example", -2084633992); }); mp.keys.bind(0x64, false, () => { mp.events.call("ShowPlaneMessage", "Title", "ShowPlaneMessage example", 788747387); // or: mp.game.ui.messages.showPlane("Title", "ShowPlaneMessage example", 788747387); }); mp.keys.bind(0x65, false, () => { mp.events.call("ShowShardMessage", "Title", "ShowShardMessage example"); // or: mp.game.ui.messages.showShard("Title", "ShowShardMessage example"); }); mp.keys.bind(0x66, false, () => { mp.events.call("ShowShardMessage", "Title", "ShowShardMessage example (colored)", 0, 11); // or: mp.game.ui.messages.showShard("Title", "ShowShardMessage example (colored)", 0, 11); }); Serverside example (will show a wasted message when you die):
mp.events.add('playerDeath', (player) => { player.call("ShowShardMessage", ["~r~Wasted", "You died."]); });
1928 downloads
(10 reviews)0 comments
Updated
-
Synced Player Component Variations
By vienna
This should save you some time writing your own syncing when it comes to using player.setClothes() for values over 255 until 1.0 gets released. The download has example scenarios/commands you can use.
Serverside Functions:
player.changeClothes(Number componentId, Number drawable, Number texture, Bool save, Bool sync) player.resetClothes() Save parameter:
By setting this to true the script will remember these values and re-apply these when using player.resetClothes()
Sync parameter:
If you set this parameter to false the clothes will only be applied on the target client.
Set this to true and everyone will see the clothes!
Demonstration:
This GIF has both save and sync parameter set to false to preview the selected item before actually purchasing it. Once purchased, both save and sync are set to true to remember the purchased item and to sync it to all other clients
https://imgur.com/a/gsySyPc
And this GIF shows the same interaction but from the other client
https://imgur.com/a/0IankaB
808 downloads
(3 reviews)0 comments
Updated
-
Basic Menu (Discontinued)
By rootcause
This project is discontinued, consider using NativeUI instead.
Bare-bones menu script.
Installing:
Put basicmenu into your server's client_packages directory, then you can add const whatever = require("basicmenu"); to the clientside scripts that you want to add a menu. Example code explains this better.
Properties & Functions:
BasicMenu
title | Get & Set | Title of the menu. (string) x | Get & Set | X position of the menu. (float) y | Get & Set | Y position of the menu. (float) items | Get & Set | An array containing all items of the menu. (MenuItem array) hoverItem | Get & Set | Index of the item you're hovering on with your cursor, -1 if not hovering on anything. (int) visible | Get & Set | Visibility of the menu. (bool) disableESC | Get & Set | Allow/disallow menu from being closed by pressing ESC key. (bool) titleFont | Get & Set | Font ID of the title. (int) titleColor | Get & Set | Text color of the title. (array containing rgba) itemsPerPage | Get & Set | How many items are visible on a page of the menu. (int) currentPage | Get & Set | Current page of the menu. (int) setBanner(lib, banner) | Sets the menu's banner to another texture, setBanner("shopui_title_carmod", "shopui_title_carmod") will set the menu banner to be Los Santos Customs one for example. MenuItem
title | Get & Set | Title of the item. (string) disabled | Get & Set | Whether the item is able to be selected or not. (bool) textColor | Get & Set | Color of the item's title. (array containing rgba) bgColor | Get & Set | Color of the item's background. (array containing rgba) icon | Get & Set | ID of the item's icon. (int) font | Get & Set | Font ID of the title. (int) outline | Get & Set | Outline of the item. (bool) shadow | Get & Set | Shadow of the item. (bool) rightText | Get & Set | Right text of the item. (string) Icon IDs:
You can put icons to menu items (even though there are only 3 options) if you want to. Just do myMenuItem.icon = desired icon ID.
MenuItemIcons.None (0) = No icon
MenuItemIcons.Lock (1) = Lock icon
MenuItemIcons.Tick (2) = Tick/checkmark icon
Events:
There are three events, see example for how to use them.
OnMenuItemSelected(menu, selectedMenuItem, selectedMenuItemIndex) /* Will be called when a menu item is clicked on/selected. menu - The menu that contained the selected item. (BasicMenu) selectedMenuItem - The menu item that was selected. (MenuItem) selectedMenuItemIndex - Index of the menu item on the selected menu. (int) */ OnMenuPageChanged(menu, oldPage, newPage) /* Will be called when a menu's page is changed. menu - The menu that had a page change. (BasicMenu) oldPage - Old page. (int) newPage - New page. (int) */ OnMenuClosed(menu) /* Will be called when a menu is closed. menu - The menu that was closed. (BasicMenu) */ Controls:
Hovering on an item and left clicking - select item
ESC - close menu (if disableESC isn't set to true)
Left Arrow - previous page
Right Arrow - next page
Example Script:
const menuLib = require("basicmenu"); // Creating a menu // you can just do: let exampleMenu = new menuLib.BasicMenu("Test Menu", 0.5, 0.4); let exampleMenu = new menuLib.BasicMenu("Test Menu", 0.5, 0.4, "commonmenu", "interaction_bgd", { itemSelected: function(item, itemIndex) { mp.gui.chat.push(`MenuEvent(${this.title}) - itemSelected: ${item.title} - ${itemIndex}`); }, pageChanged: function(oldPage, newPage) { mp.gui.chat.push(`MenuEvent(${this.title}) - pageChanged: ${oldPage} to ${newPage}`); }, closed: function() { mp.gui.chat.push(`MenuEvent(${this.title}) - close`); } }); exampleMenu.itemsPerPage = 5; // make the menu show 5 items per page, this is default by 10 let normalItem = new menuLib.MenuItem("Normal Item"); normalItem.rightText = "Free"; exampleMenu.items.push(normalItem); let redBackground = new menuLib.MenuItem("Red Background Item", [255, 255, 255, 255], [255, 0, 0, 200]); redBackground.rightText = "~g~$500"; exampleMenu.items.push(redBackground); let greenText = new menuLib.MenuItem("Green Text Item", [0, 255, 0, 255]); exampleMenu.items.push(greenText); // You won't be able to click on disabled items. let disabledItem = new menuLib.MenuItem("Disabled Item"); disabledItem.disabled = true; exampleMenu.items.push(disabledItem); let itemWithIcon = new menuLib.MenuItem("Item with Icon", [255, 255, 255, 255], [0, 0, 0, 200], function() { mp.gui.chat.push("You selected the item with icon, why?"); }); itemWithIcon.icon = menuLib.MenuItemIcons.Tick; itemWithIcon.rightText = "Pretty cool"; exampleMenu.items.push(itemWithIcon); let disabledWithIcon = new menuLib.MenuItem("Top Secret"); disabledWithIcon.disabled = true; disabledWithIcon.icon = menuLib.MenuItemIcons.Lock; exampleMenu.items.push(disabledWithIcon); // You can disable ESC menu closing by using disableESC property. exampleMenu.disableESC = true; // This is important as menus are not visible by default. exampleMenu.visible = true; // Events // OnMenuItemSelected, will be called when a menu item is clicked on. mp.events.add("OnMenuItemSelected", (menu, selectedItem, selectedItemIndex) => { mp.gui.chat.push(`Item selected on menu (${menu.title}) - ${selectedItem.title} (Index: ${selectedItemIndex})`); }); // OnMenuPageChanged, will be called when a menu's current page changes. mp.events.add("OnMenuPageChanged", (menu, oldPage, newPage) => { mp.gui.chat.push(`Menu page changed (${menu.title}) - ${oldPage} to ${newPage}`); }); // OnMenuClosed, will be called when a menu item is closed. mp.events.add("OnMenuClosed", (menu) => { mp.gui.chat.push(`Menu closed (${menu.title})`); }); // F6 key will toggle the visibility of exampleMenu mp.keys.bind(0x75, false, () => { exampleMenu.visible = !exampleMenu.visible; });
1070 downloads
(5 reviews)0 comments
Updated
-
Rappelling
By rootcause
Requires RAGE Multiplayer 1.1.0 and above.
Installing
Put rappel into your server's client_packages directory, then add require('rappel'); to client_packages/index.js.
RAGE Multiplayer's 1.1 will sync the rappelling action so there isn't any need for server-side files.
Using
Get in a helicopter with FLAG_ALLOWS_RAPPEL (Maverick, Police Maverick and Annihilator) flag as passenger and do /rappel.
* Credits to Trevor Productions on YouTube for the preview image.
987 downloads
(7 reviews)0 comments
Submitted
-
Timecycle Modifiers
By rootcause
This resource lets you preview many of the available timecycle modifiers in GTA V.
Installing
Download & install the latest BasicMenu or NativeUI if you haven't already, this script needs it Drop the timecycpreview folder to your server's client_packages Add require('timecycpreview') to client_packages/index.js All done Controls
Page Up - Increase timecycle modifier strength Page Down - Decrease timecycle modifier strength F9 - Show/hide the menu
261 downloads
(2 reviews)0 comments
Updated
-
Synced Vehicle Indicators
By rootcause
Installing
Put the files you downloaded in their respective places Add require('indicators') to client_packages/index.js All done Controls
Numpad 4 - Toggle left indicator Numpad 6 - Toggle right indicator1250 downloads
(4 reviews)0 comments
Updated
-
Vending Machine Script (C#)
By JAYT
Source code : https://github.com/J4YT/RAGE-Multiplayer-Vending-Machine-Script
Only works in combination with the Attachment Sync resource. (see below)
Requires Rage 1.1 to work.
424 downloads
(1 review)0 comments
Updated
-
Console commands
By m4a_X
Simple command handler for the Rage:MP console...
... Just add more commands, for example to save the player
INFO: Stopping bridge resources seems to be broken by Rage.
Original resource by Vektor42O
535 downloads
(0 reviews)0 comments
Updated
-
Manage Weather Time
By Nov4tO266
Basic script to sync time of the game in custom cicles
That script just change the time of the game based on the configuration cicle time and real life.
every 0 hour and 12 hours the weather is changed in random mod to another weather.
The cicle of Timeout will adjust to read the script every hour in the game.
How to use:
Just place de script in your server-side (Package) and change the "const cicleTime" to your
size of a day cicle. Use real life minutes for that. Exemple: "30" will be 15 minutes in real life day
and 15 minutes night.
Notes:
If you place some value in cicle time that a hour in the game last less then one minute in real life,
dont will work (if you know how to fix comment please ).
Future Updates:
Smoth transition, show time and date on UI
1138 downloads
(1 review)0 comments
Updated
-
Simple MoneyHUD
By MiMIMi
What is this?
This is a simple money HUD for rage It is easy to add and use in your existing application or a new one! It is very similiar to SAMP's money HUD It contains nice animations on money adding/removing (Check the included GIF) How to install?
Extract the MoneyHUD.js file in your client_packages and include it in your index.js require('./MoneyHUD.js'); Note
This was created in version 0.3.7 How to use?
Call event moneyhud:set on player initialization/connect to initialize player's starting money - Example: client.TriggerEvent("moneyhud:set", 5000); Call event moneyhud:add to add money to the HUD - Example: client.TriggerEvent("moneyhud:add", 1500); Call event moneyhud:remove to remove money from the HUD - Example: client.TriggerEvent("moneyhud:remove", 1500); Extra settings
You can change the MINIMUM_LENGTH constant to determine how long should the money HUD be by minimum1165 downloads
(2 reviews)0 comments
Updated
-
GTAO Outfits
By rootcause
This script reads outfits from scriptmetadata.meta and lets you use them in game. There are currently 1382 outfits for both male and female freemode characters.
Using: /outfit [id]
Updating scriptmetadata.meta
scriptmetadata.meta gets more outfits with every update, here's how you can update it:
OpenIV:
Go to update\update.rpf\common\data Right click on scriptmetadata.meta Select save content/export Take the extracted file and replace it with the one your server is using CodeWalker RPF Explorer:
Go to update\update.rpf\common\data Right click on scriptmetadata.meta Select extract raw Take the extracted file and replace it with the one your server is using Notes
Some outfit IDs might do nothing, ask Rockstar In RAGE version 0.3, drawable IDs above 255 aren't supported so you might have some weird looking outfits. From what I heard this is not a problem in upcoming 0.4. Credits to OpenIV and CodeWalker devs, this script wouldn't be possible without their efforts.
1252 downloads
(6 reviews)0 comments
Updated
-
FireDepartment
By spacefrog
I made this script for beginners in c# so they can hopefully learn someting for it.
I'm not a pro in programming but i hope i can help someone with it.
I did not test this with other players but it should work.
Commands:
/teleport "to get to the fire department" /start1 "on the white colshape to start a fire" /stopfireid "to stop the fire or just extinguish it."
When you are on a mission you can heal your self on the green colshape.
When you start a fire it random selected one of the 6 main spawn points from that point it random create new spawn points and check if its reachable for the player.
961 downloads
- Fire fighter
- Fire Department
- (and 1 more)
(1 review)0 comments
Updated
-
BlockVPN
BlockVPN NodeJS Resource
Purpose
Block players from joining if they are on a VPN or proxy. About
This resource uses GetIPIntel which is a free service that calls their API with the IP address and returns the likelihood of it being a VPN or proxy. The recommended threshold to block is 0.99 and above; any lower and you may get false positives. Requirements
request (NodeJS Module) GitHub
The resource GitHub can be found here.266 downloads
(0 reviews)0 comments
Updated
-
Blackout
By rootcause
This resource lets you control the blackout feature of GTA V.
Installing
Put the files you downloaded in their respective places Add require('blackout') to client_packages/index.js All done
API
// Serverside (synced to every player) mp.world.blackout.enabled // get mp.world.blackout.enabled = true/false // set // Clientside (only for a client) mp.game.blackout.enabled // get mp.game.blackout.enabled = true/false // set You can also trigger SetBlackoutState event with the first argument being the new state of blackout.
Example
// Toggle blackout mode with /toggleblackout (Serverside) mp.events.addCommand("toggleblackout", (player) => { mp.world.blackout.enabled = !mp.world.blackout.enabled; player.outputChatBox(`Blackout ${mp.world.blackout.enabled ? `enabled` : `disabled`}.`); }); // Toggle blackout mode with F8 key (Clientside) mp.keys.bind(0x77, false, () => { mp.game.blackout.enabled = !mp.game.blackout.enabled; mp.gui.chat.push(`Blackout ${mp.game.blackout.enabled ? `enabled` : `disabled`}.`); });
817 downloads
(1 review)0 comments
Updated
-
Basic Player Blips
By rootcause
This resource adds GTAO style player blip/icon to streamed in players. Their icon will be removed when they stream out.
You can change the color of player blips by setting blipColor using Entity::data or Entity::setVariable on serverside. For a list of blip colors, visit the wiki page about blips.
Installing
Put playerblips into your server's client_packages directory, then add require('playerblips'); to index.js.
2225 downloads
(6 reviews)0 comments
Updated
-
Firing Modes
By rootcause
This script was originally made by EnforcerZhukov for singleplayer. (you can find it here) All credit goes to him.
I added extra stuff such as remembering firing mode (until you disconnect) per weapon, safety mode, HUD item and sound effects.
Installing & Using
Put guncontrol into your server's client_packages directory, then add require('guncontrol'); to index.js. Press F6 key to switch between firing modes.
Firing Modes
Auto: Default GTA shooting. Burst: Shoot 3 bullets every time you fire. (not supported on all weapons) Single: Shoot 1 bullet every time you fire. (not supported on all weapons) Safe: Disables shooting.
448 downloads
(1 review)0 comments
Updated
-
Client-side AntiCheat
So this is a simple Script, that detects suspicious actions from client-side:
- No Reload
- Unallowed Weapons
- Rapid Fire
- Flyhacks
- Speedhacks
- Vehicle Fly and Speedhacks
- Static Godmodes and Healkeys
Showcase: https://streamable.com/iklquo
When you teleport, heal or respawn the player, use the 'client:respawning' event.
If you want to use something like Medkits or Respawns you need to trigger the 'client:respawning' event, which disables the AntiCheat for some seconds, otherwise the player gets flagged.
Do your own thing for Vehicle Flyhack flagging, because on my server, you don't do those big Car Stuntjumps, where you fly like 30m high. Maybe remove that flagging.
NOTE: There are many reasons that can cause false flags, for example high-ping or low fps.
Dont ever autoban people with this!
1621 downloads
(3 reviews)0 comments
Updated
-
Speedometer KM/h, RPM and Fuel
By valdirdd
Design by @CommanderDonkey, link here.
For install just copy files to your server.
Don't forget edit index.js into client_packages if you have more resources.
3910 downloads
(3 reviews)0 comments
Submitted
