Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/13/18 in all areas

  1. Version 0.3

    4706 downloads

    NEW VERSION: Version 0.3 - March 22nd, 2018 Changelog(0.3) -Support for 1.43 added. This resource also supports 1.41 and 1.42. -Added freeze/unfreeze ability for objects. (Use this on doors. Just press F to toggle) -Fix duplication bug. Changelog(0.2.2) -Fix "mobj" command with string/number hash detection. Changelog(0.2.1) -Fix crash when trying to dupe map hashes. Changelog(0.2) -Dupe function (Right click objects and you can place the same object again) (Works on non-editor objects). -Hash checker (Look at any object on the map, not just editor objects to check their hash). -Auto adjustement in placement stage. Right click to automatically rotate/position object on the ground. -Scroll improvement by loading models ahead of time. -Other fixes. -Some code restructure thanks to mtz64. Changelog (0.1) -Initial Release Yes there are lack of features or some bugs, 0.1. Make bug reports/suggestions if you have any. **Note that your current edit is autosaved every 30 seconds. To load it call '/mload autosave'. (Yes I know commands throw "Command not found". Ignore it for now) There are roughly 50,000 objects. The list needs a bit of cleaning but it includes many new objects not seen before such as sections of the map. Installation: Drop the "MapEditor" folder inside the "client_packages" folder into your own "client_packages" folder. Merge the index.js file found inside "client_packages" with your own. Drop the "MapEditor" folder inside the "packages" folder into your own "packages" folder. Usage: To start/exit the editor press F2. (NOTE THAT OBJECTS CURRENTLY IN EDIT MODE WILL REMAIN ON THE MAP. USE /mclear) Press 1 for Selector Mode (You can click on objects, or click off to deselect) Press 2 for Object Placement Mode Press 3 for Adjustment Mode Press ENTER to save objects inside Adjustment Mode. Press SPACE to rotate objects by 90 degrees in Object Placement Mode. WASD to move around. E and Q to move up and down. Shift to speed up movement, control to slow down movement. Ctrl + Z to undo object creation, Ctrl + Y to redo it. This only applies to object creation for now. Controls are defined on the screen for you. Mostly point, click, and drag. Commands: (Yes, commands in 2018, stop crying until I make some UI framework) /msave [name] - used to save your map /mmaps - used to see what maps you have saved in your session /mload [name] - used to load a map (you can load/deload as many maps as you want) (it is synced) /mdeload [name] - used to deload a map if it is loaded (not if it's in edit mode) /mlmaps - used to see what maps are loaded (That's an "L" not an "I") /medit [name] - used to edit a map (it will load in client sided only and you can edit it) /mclear - used to clear your current edit /mindx [index number] - used to set the list index since it is a huge list /mobj [name of hash] - used to spawned a specific object by name API: LoadMap(name); DeloadMap(name); SaveMap(name, data); DO NOT PASS IN THE "_map.json" EXTENSION. THAT IS HANDLED ON ITS OWN. ONLY PASS THE NAME YOU SAVED IT AS. Ex. /msave map1 - will save it as map1_map.json. To load it call /mload map1 or LoadMap("map1"); https://github.com/DisapprovedByMe/MapEditor
    6 points
  2. Нет, о эрпэ даже не думал, хочу дм, идеи есть, навыков нету, в общем буду пробывать =)
    1 point
  3. This function is intended to simulate that the tires break when fired. getClosestVehicle() returns only one int, not the vehicle handle. Here is my working client-side script: mp.events.add('playerWeaponShot', (targetPosition) => { let nearestVehicle = mp.game.vehicle.getClosestVehicle(targetPosition.x, targetPosition.y, targetPosition.z, 2, 0, 70); if( nearestVehicle != 0 ) { // chance of damage if( Math.floor((Math.random() * 100) + 1) < 25 ) { for (var i = 0; i < 4; i++) { var DamagedWheel = Math.floor((Math.random() * 9)); mp.vehicles.atHandle(nearestVehicle).setTyreBurst(DamagedWheel, true, 1000); } } } }); But I think it's easier and safer to run these functions on the server side. Here is an example from my server: mp.events.add('vehicle_toggle_lock', (Player) => { var NearbyVehicles = []; mp.vehicles.forEachInRange(Player.position, 2.5, (NerbyVehicle) => { NearbyVehicles.push(NerbyVehicle); }); // sort the vehicles by range (0 is closest to the player) NearbyVehicles.sort(function(a, b){return b.dist(Player.position)-a.dist(Player.position)}); if( NearbyVehicles.length > 0 ) { if( NearbyVehicles[0].locked ) { NearbyVehicles[0].locked = false; Player.notify("You ~g~unlocked the vehicle."); // MySQL_Conn.query("UPDATE vehicles SET veh_locked='0' WHERE vehicle=?", [NearbyVehicles[0].data.id]); } else { NearbyVehicles[0].locked = true; Player.notify("You ~r~locked the vehicle."); // MySQL_Conn.query("UPDATE vehicles SET veh_locked='1' WHERE vehicle=?", [NearbyVehicles[0].data.id]); } } });
    1 point
  4. Use explode() in server-side
    1 point
  5. No, did some quick test getClosestVehicle returned for me typeof(thenearestVehicle) is number and JSON.stringify(thenearestVehicle) is 7682 which i consider to be handle id. When you add some more test code from wiki for example testob.setTyreBurst(0, false, 1000); testob.setTyreBurst(1, false, 1000); testob.setTyreBurst(4, false, 1000); testob.setTyreBurst(5, false, 1000); you will see that the closest vehicle has all tires popped but did not explode, because .explode() method does not seem to be working even trying example from wiki if( commandName === "exptest") { var vehicle = mp.vehicles.new(989294410, localPlayer.position); //Spawns Voltic2 at 'player' position vehicle.explode(); } car was spawned without explosion in current 0.3.5 release. So stuff with atHandle mentioned earlier is the right way to do this edit: btw i made it explode using testob.explodeInCutscene(true);
    1 point
  6. Version 1.0.0

    164 downloads

    DxBar messages is a light easy to use script to show some notifications for your players. Just calling one event with your custom message and colored text. Usage: //Server-side player.call('Createinfo', '<text>', R, G, B, 'top or bot') //Client-side mp.events.call('Createinfo', '<text>', R, G, B, 'top or bot') Images are available at the old topic in forums, due to inability to restore them. (images will be added asap).
    1 point
  7. The Chromium Embedded Framework (CEF) is a useful "embedding framework" that allows applications to make use of browser based technologies. (https://bitbucket.org/chromiumembedded/cef) CEF is comprised (especially in the example and answer to your question, provided by Kemperr) of HTML, CSS and Javascript on a frontend basis. You can store these files clientside and use them within your CEF calls (as part of index.js or required within thereof). To render them we refer to a URL that references the path of the client_packages directory (inside your server's directory). EXAMPLE: mp.browsers.new('package://menu/index.html'); // This would refer to client_packages/menu/index.html A working example would be to place that in an event handler on your clientside, like so: mp.events.add('guiReady', () => { mp.browsers.new('package://menu/index.html'); // Here we display the browser instance to the client }); CEF can handle ES5 and ES6 scripting, so there is very little limitation on what you can do in terms of front-end work. --- Alternatively, you can opt-in to using the NativeUI stuff: https://github.com/alexguirre/RAGENativeUI Which I wouldn't recommend if you are not well versed in .NET (or rather, C#)
    1 point
×
×
  • Create New...