Sn00py Posted September 10, 2018 Posted September 10, 2018 'veh' : (player, fullText, model) => { if (player.adminLvl < 1) return; if (!model) return player.notify("Benutze /veh Name"); const d = { model, coord: misc.getPlayerCoordJSON(player), id: 0, title: model, fuel: 100, fuelTank: 60, fuelRate: 10, price: 1, ownerId: 0, whoCanOpen: JSON.stringify([player.guid]), factionName: 'Team', numberPlate: 'ADMIN', primaryColor: JSON.stringify([ misc.getRandomInt(0, 159), misc.getRandomInt(0, 159), misc.getRandomInt(0, 159) ]), secondaryColor: JSON.stringify([ misc.getRandomInt(0, 159), misc.getRandomInt(0, 159), misc.getRandomInt(0, 159) ]), setNeonColour : JSON.stringify([ misc.getRandomInt(0, 255), misc.getRandomInt(0, 255), misc.getRandomInt(0, 255) ]), setNeonLightsColour: JSON.stringify([ misc.getRandomInt(0, 255), misc.getRandomInt(0, 255), misc.getRandomInt(0, 255) ]), } const vehicle = new Vehicle(d); player.putIntoVehicle(vehicle, -1); misc.log.debug(`${player.name} spawned ${model}`); player.notifyWithPicture("Hinweis", "", "Du hast dir erfolgreich ein " + model + " gespawned!", "CHAR_CARSITE"); }, Why My Neon Colors wont enabled?
MrPancakers Posted September 10, 2018 Posted September 10, 2018 Don't you need this? https://wiki.rage.mp/index.php?title=Vehicle::setNeonLightEnabled
Sn00py Posted September 10, 2018 Author Posted September 10, 2018 class Vehicle { constructor (d) { const pos = JSON.parse(d.coord); const vehicle = mp.vehicles.new(d.model, new mp.Vector3(pos.x, pos.y, pos.z), { heading: pos.rot, dimension: pos.dim, locked: true, engine: false, }); vehicle.guid = d.id; vehicle.title = d.title; vehicle.fuel = d.fuel; vehicle.fuelTank = d.fuelTank; vehicle.fuelRate = d.fuelRate; vehicle.price = d.price; vehicle.ownerId = d.ownerId; vehicle.whoCanOpen = JSON.parse(d.whoCanOpen); vehicle.factionName = d.factionName; vehicle.windowsOpened = [false, false, false, false]; vehicle.numberPlate = d.numberPlate; vehicle.setNeonColour = d.setNeonColour; vehicle.setNeonLightsColour = d.setNeonLightsColour; vehicle.setNeonLightEnabled = [true]; const primaryColor = JSON.parse(d.primaryColor); const secondaryColor = JSON.parse(d.secondaryColor); vehicle.setColorRGB(primaryColor[0], primaryColor[1], primaryColor[2], secondaryColor[0], secondaryColor[1], secondaryColor[2]); vehicle.canOpen = function(player) { if (player.dimension !== this.dimension) return false; if (player.faction.name && player.faction.name === this.factionName) return true; for (const p of this.whoCanOpen) { if (p !== player.guid) continue; return true; } return false; } i think no
hexisgod Posted September 11, 2018 Posted September 11, 2018 If server-side you can use it: vehicle.neonEnable = true / false; vehicle.setNeonColor(R, G, B);
padcmoi Posted November 3, 2018 Posted November 3, 2018 On 9/12/2018 at 1:10 AM, hexisgod said: If server-side you can use it: vehicle.neonEnable = true / false; vehicle.setNeonColor(R, G, B); Hello, Yes, but the function vehicle::neonEnable is buggy in contrary to the client-side function setNeonLightEnabled , for my part vehicle::neon, works 1 time out of 3 at each refresh of the server. There is not another method ?, to use the client side function and above visible of everyone, because of callbacks to this command call(), only the owner can see the neon lights Cordially
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now