Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/05/23 in all areas

  1. Version 1.0.4

    4086 downloads

    Most of the server developers (ones that don't patiently wait for *something large*, though this resource is powerful enough) use their own server-side object attachments implementation that represents some large JSON with all the object and attachment information. This resource lets you cache "static attachments" in the client-side code so thanks to efficient utilization of the shared data it just uses a small shared variable to do the attachment processing without any need to create server-side objects nor send its data. For example, if you want to attach a specific object to specific ped bone with spefic bone offset and object rotation, this will only use a ~4-8 byte shared variable keeping it accurate. User-made implementations I have seen before usually take ~100 bytes per an object. API: Client-side mp.attachmentMngr.register(attachmentId, model, bone, offset, rotation) mp.attachmentMngr.addLocal(attachmentId) (synced!) mp.attachmentMngr.removeLocal(attachmentId) (synced!) API: Server-side player.addAttachment(attachmentId, remove) player.hasAttachment(attachmentId) Example Resource There's an example resource in /client-packages/epic-attachments folder. It lets you toggle attachments (there are like 30 attachments) using a NativeUI-based menu. Thanks to root for his contributions made to the example resource.
    1 point
  2. Version 1.0.0

    447 downloads

    Features Sync Streamer Events Easy to use API + Added mp.particleFx.addLoopedAtCoord (Synced!) + Added mp.particleFx.addLoopedOnEntity (Synced!) + Added mp.particleFx.destroy (Synced!) + Added player.startParticleFxLoopedAtCoord (Not synced!) + Added player.startParticleFxLoopedOnEntity (Not synced!) + Added player.stopParticleFx (Not synced!) Examples mp.events.add({ 'onPlayerParticleFxStreamIn' : (player, particleId) => { console.log(`[onPlayerParticleFxStreamIn] => ${player.name} - ${particleId}`); }, 'onPlayerParticleFxStreamOut' : (player, particleId) => { console.log(`[onPlayerParticleFxStreamOut] => ${player.name} - ${particleId}`); }, 'onParticleFxEntityDisconnect' : (player, particleId) => { console.log(`[onParticleFxEntityDisconnect] => ${player.name} - ${particleId}`); } }); mp.events.addCommand({ 'fx_carwash2_stop' : (player) => player.stopParticleFx('car.wash2'), 'fx_carwash2' : (player) => { const id = 'car.wash2', fxName = 'scr_carwash', effectName = 'ent_amb_car_wash_jet', position = { x: player.position.x, y: player.position.y, z: player.position.z + 3.0 }, rotation = { x: 0, y: 0, z: 0 }, scale = 15.0, xAxis = true, yAxis = true, zAxis = true ; player.startParticleFxLoopedAtCoord(id, fxName, effectName, position, rotation, scale, xAxis, yAxis, zAxis); } }) mp.events.addCommand({ 'fx_carwash_stop' : () => mp.particleFx.destroy('car.wash'), 'fx_carwash' : (player) => { const id = 'car.wash', fxName = 'scr_carwash', effectName = 'ent_amb_car_wash_jet', position = { x: player.position.x, y: player.position.y, z: player.position.z + 3.0 }, rotation = { x: 0, y: 0, z: 0 }, scale = 15.0, xAxis = true, yAxis = true, zAxis = true ; mp.particleFx.addLoopedAtCoord(id, fxName, effectName, position, rotation, scale, xAxis, yAxis, zAxis); } }); mp.events.addCommand({ 'fx_moneyrain' : (player) => { const id = 'moneyrain', fxName = 'scr_xs_celebration', effectName = 'scr_xs_money_rain_celeb', offset = { x: 0.0, y: 0.0, z: 1.25 }, rotation = { x: 0, y: 0, z: 0 }, scale = 1.25, xAxis = true, yAxis = true, zAxis = true ; const fx = mp.particleFx.addLoopedOnEntity(id, player, fxName, effectName, offset, rotation, scale, xAxis, yAxis, zAxis); setTimeout(() => fx.destroy(), 9000); } }); mp.events.addCommand({ 'fx_barber' : (player) => { const id = 'barber', fxName = 'scr_barbershop', effectName = 'scr_barbers_haircut', offset = { x: 0.0, y: 0.0, z: 0.75 }, rotation = { x: 0, y: 0, z: 0 }, scale = 1.0, xAxis = true, yAxis = true, zAxis = true ; const fx = mp.particleFx.addLoopedOnEntity(id, player, fxName, effectName, offset, rotation, scale, xAxis, yAxis, zAxis); setTimeout(() => { fx.destroy(); player.setClothes(2, Math.floor(Math.random() * 74), 0, 2); }, 900); } }); Introduction
    1 point
×
×
  • Create New...