Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/30/19 in all areas

  1. player.call(`Test`, [1]); По-моему правильно использовать это так. Возможно, не решит вашу проблему, по-моему console.log не возможно вызвать со стороны клиента.
    2 points
  2. Да, вызывать её через серверный эвент.
    1 point
  3. 1 point
  4. Version 1.0.0

    192 downloads

    This resource provides 3 serverside functions to work with tire smoke color feature of GTA V. Installing Put the files you downloaded in their respective places Add require('tiresmoke') to client_packages/index.js All done Serverside API /** * Sets the tire smoke color of a vehicle. * @param {Number} red * @param {Number} green * @param {Number} blue */ vehicle.setTyreSmokeColor(red, green, blue); /** * Gets the tire smoke color of a vehicle. * @return {Object} Tire smoke color, will be null if the vehicle doesn't have one set. */ vehicle.getTyreSmokeColor(); /** * Resets the tire smoke color of a vehicle. */ vehicle.resetTyreSmokeColor(); Example Code // Example: /setsmokecol 255 0 0 mp.events.addCommand("setsmokecol", (player, _, r, g, b) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.vehicle.setTyreSmokeColor(Number(r), Number(g), Number(b)); player.outputChatBox("smoke color set"); }); // Output: "smoke color: {"r":255,"g":0,"b":0}" or "smoke color: null" if you haven't used setsmokecol before mp.events.addCommand("getsmokecol", (player) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.outputChatBox(`smoke color: ${JSON.stringify(player.vehicle.getTyreSmokeColor())}`); }); mp.events.addCommand("remsmokecol", (player) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.vehicle.resetTyreSmokeColor(); player.outputChatBox("smoke color reset"); }); Notes Since this script toggles the tire smoke mod (toggleMod 20), it may not work with your car customization script. Setting the tire smoke color of a vehicle, then changing its model will cause visual desync. Apply tire smoke color again/reset it after changing a vehicle's model to not have this issue. Even though NativeDB says setting the RGB to 0, 0, 0 applies independence day tire smoke, all it did for me was make the tire smoke invisible. Future versions of RAGEMP might add tire smoke color sync, if it happens you should stop using this resource. Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-tire-smoke
    1 point
  5. Верно. В дополнение к этому советую использовать https://github.com/micaww/rage-rpc вместо стандартных ивентов. Намного упрощает работу.
    1 point
  6. server: mp.events.add("debug", (player, text) => { console.log(text); }); client: mp.events.add('Test', (anything) => { mp.events.callRemote("debug", "Test client"); mp.events.callRemote("debug", "anything"); })
    1 point
  7. GTA5 похоже не обновленная, как и рейдж.
    1 point
  8. Update: 1.48 support has been pushed into main updater branch. This morning we've announced public beta testing of 1.47 compatibility patch in the Discord, but as far as we realized later a lot of players still didn't join our Discord server (or just got banned for rules violation) so we've decided to inform everyone about the testing here as well. If you wish to participate in the testing, please open config.xml in RAGE Multiplayer root folder and change "prerelease" to "03_undefined". Bugs are possible since it's a testing release but issues are being rapidly resolved to make it stable enough to push it into the default branch. Server update is not required. { reminder to join our Discord here }
    1 point
  9. Thanks for snippets. I modified this a little bit to work distant locations where the map isn't properly loaded. Here is the code. if (mp.game.invoke('0x1DD1F58F493F1DA5')) { let blipIterator = mp.game.invoke('0x186E5D252FA50E7D'); let FirstInfoId = mp.game.invoke('0x1BEDE233E6CD2A1F', blipIterator); let NextInfoId = mp.game.invoke('0x14F96AA50D6FBEA7', blipIterator); for (let i = FirstInfoId; mp.game.invoke('0xA6DB27D19ECBB7DA', i) != 0; i = NextInfoId) { if (mp.game.invoke('0xBE9B0959FFD0779B', i) == 4) { let oldpos = mp.players.local.position; let coord = mp.game.ui.getBlipInfoIdCoord(i); coord.z = mp.game.gameplay.getGroundZFor3dCoord(coord.x, coord.y, i * 50, 0, false); // try calcualte Z mp.players.local.position = coord; mp.players.local.freezePosition(true); setTimeout(function () { // let the game load the map let j = 0; while (j <= 60 && coord.z == 0) { // try to find it by trying different heights coord.z = mp.game.gameplay.getGroundZFor3dCoord(coord.x, coord.y, i * 25, 0, false); j++; } if (coord.z != 0) { // if found groundZ mp.players.local.position = coord; } else { mp.players.local.position = oldpos; mp.gui.chat.push("Could not find elevation at waypoint position!"); } mp.players.local.freezePosition(false); }, 1500); } } } Works by teleporting you there, freezing you then calculating the GroundZ. If it finds it, it places you there else it teleports you back to your original position.
    1 point
×
×
  • Create New...