Функции
Синхронизировать
Стример
События
Легко использовать
API
JavaScript:
+ 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
JavaScript:
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);
}
});
JavaScript:
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);
}
});
Вложения
Последнее редактирование: