...
 
Commits (5)
......@@ -7,7 +7,7 @@ conf.json
bt.dat
*.log
/plugins/*
/packages/*
/packages/RP/*
/client_packages/*
/app/server/sMysql.js
/app/server/sMailer.js
\ No newline at end of file
html {
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
font-family: Segoe UI;
font-weight: 100;
color: #DDD;
text-align: center;
}
.b3-close {
background: coral;
position: absolute;
right: 0;
top: 0;
width: 6vh;
height: 3vh;
font-size: 2vh;
transition: 0.3s;
z-index: 2;
}
.b3-close:hover {
background: tomato;
}
.b1-logo {
background: #268F3A;
width: 100%;
position: absolute;
left: 0;
top: 0;
height: 40vh;
z-index: 1;
display: flex;
flex-wrap: wrap;
position: fixed;
transition: 1s;
}
.logoLoading {
height: 100vh;
}
.logo {
margin: auto;
/*height: 40vh;*/
}
.b1-tax {
text-transform: uppercase;
font-size: 2.5vh;
color: white;
}
.b2 {
position: fixed;
left: 0;
top: 40vh;
width: 100%;
height: 70vh;
}
.b2-gs {
width: 100%;
background: #DDD;
border-bottom: 1px solid #777;
display: flex;
padding: 2vh 0;
}
.b2-gs-item {
width: 100%;
text-align: center;
border-left: 1px solid #777;
font-size: 3vh;
color: green;
padding: 0 1vw;
}
.b2-gs-item:nth-child(1) {
border-left: 1px solid transparent;
}
.b2-title {
color: #777;
}
.gs-main {
font-size: 3vh;
}
.gs-info {
font-size: 1.5vh;
color: #777;
text-transform: uppercase;
}
.gs-dollar-before:before {
content: "$";
}
.gs-percent-after:after {
content: "%";
}
.b2-buttons {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 42vh;
position: relative;
}
.b2-button {
width: calc(100% - 40vw);
background: #268F3A;
text-align: center;
margin: auto 20vw;
color: #EEE;
font-size: 2vh;
padding: 2vh 0;
text-transform: uppercase;
transition: 0.3s;
position: relative;
}
.b2-button:hover {
background: green;
color: #ddd;
}
.b2-cb {
position: absolute;
top: 0;
padding: 2vh 0;
width: 7vh;
color: white;
transition: 0.3s;
}
.b2-cb_left {
left: 0;
}
.b2-cb_left:hover {
background: tomato;
}
.b2-cb_right {
right: 0;
}
.b2-cb_right:hover {
background: limegreen;
}
<html>
<meta charset="utf-8">
<link rel="stylesheet" href="mechanic.css">
<script src="../vue.js"></script>
<body>
<div id="app">
</div>
</body>
</html>
<script>
const app = new Vue({
el: '#app',
data: {
},
methods: {
changeCamRotation: function() {
mp.trigger("cChangeHeading", this.camRotation);
},
exit: function() {
mp.trigger("cCloseCefAndDestroyCam");
},
});
</script>
\ No newline at end of file
This diff is collapsed.
.b3-close {
background: coral;
position: fixed;
right: 0;
top: 0;
width: 6vh;
height: 3vh;
font-size: 2vh;
transition: 0.3s;
z-index: 3;
}
\ No newline at end of file
<html>
<meta charset="utf-8">
<link rel="stylesheet" href="paint.css">
<script src="../../../vue.js"></script>
<script src="jscolor.js"></script>
<body>
<div id="app">
<div class="b3-close" id="close-button" @click="exit">X</div>
<h1>{{ titleText }}</h1>
</div>
</body>
</html>
<script>
const app = new Vue({
el: '#app',
data: {
titleText: "Paint Bay",
prime: service.primeColor,
second: service.secondaryColor,
},
methods: {
changeCamRotation: function() {
mp.trigger("cChangeHeading", this.camRotation);
},
setPaint: function() {
const paint = {
primary: this.prime,
secondary: this.second,
}
mp.trigger("cMisc-CallServerEvent", "sAutoShop-SetPaint", JSON.stringify(paint));
this.exit()
},
exit: function() {
mp.trigger("cCloseCefAndDestroyCam");
}
}
})
</script>
\ No newline at end of file
"use strict";
const misc = require('../cMisc');
const player = mp.players.local;
const vehicle = player.vehicle
mp.events.add(
{
"cAutoShop-ShowPaintMenu" : (service) => {
misc.prepareToCef();
misc.openCef("package://RP/Browsers/Business/AutoShop/Paint/paint.html");
misc.injectCef(service);
misc.createPointedCam(103.13, 6626.423, 32.828, 0, 0, 0, 80, 102.738, 6623.627, 31.829)
// setTimeout(function(){
// misc.destroyCam();
// },3000)
},
"cAutoShop-ShowMechanicMenu" : () => {
//misc.prepareToCef();
//misc.openCef("package://RP/Browsers/Business/AutoShop/Mechanic/mechanic.html");
//misc.injectCef(inject);
misc.createPointedCam(110.48, 6631.676, 31.787, 0, 0, 0, 80, 109.888, 6626.924, 31.787)
setTimeout(function(){
misc.destroyCam();
},3000)
},
"cAutoShop-ShowDevMenu" : () => {
misc.prepareToCef()
misc.openCef("package://RP/Browsers/Business/AutoShop/Paint/paint.html")
},
"cMisc-CallServerEvent" : (eventName, id, price) => mp.events.callRemote(eventName, id, price),
//"cAutoShop-SetVehicleColor" : (col1, col2) => vehicle.setColours(col1, col2)
});
// RAGE Object Declarations
//paleto right garage
//mp.game.object.doorControl(-822900180, 114, 6623, 32, true, 0, 0, 0);
//paleto left garage
//mp.game.object.doorControl(-822900180, 108, 6617, 32, true, 0, 0, 0);
//paleto paint garage
//mp.game.object.doorControl(106.161, 6619.949, 32, true, 0, 0, 0);
\ No newline at end of file
......@@ -8,4 +8,4 @@ mp.events.add({
misc.openCef("package://RP/Browsers/Business/business.html", lang);
misc.injectCef(inject);
}
});
});
\ No newline at end of file
......@@ -62,6 +62,16 @@ function createCam(x, y, z, rx, ry, rz, viewangle) {
}
exports.createCam = createCam;
// POINTED CAMERA //
function createPointedCam(x, y, z, rx, ry, rz, viewangle, px, py, pz) {
camera = mp.cameras.new("Cam", {x, y, z}, {x: rx, y: ry, z: rz}, viewangle);
camera.setActive(true);
camera.pointAtCoord(px, py, pz)
mp.game.cam.renderScriptCams(true, true, 20000000000000000000000000, false, false);
}
exports.createPointedCam = createPointedCam;
function destroyCam() {
if (!camera) return;
camera.setActive(false);
......
......@@ -6,6 +6,7 @@ require('./Business/cBusiness');
require('./Business/cCarDealership');
require('./Business/cClothingShop');
require('./Business/cBarberShop');
require('./Business/cAutoShop');
require('./Business/cGasStation');
require('./Basic/cVehicle');
require('./Jobs/cOrangeCollector');
......
......@@ -25,9 +25,10 @@ class Vehicle {
vehicle.windowsOpened = [false, false, false, false];
vehicle.numberPlate = d.numberPlate;
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]);
const primaryColor = d.primaryColor;
const secondaryColor = d.secondaryColor;
vehicle.setColor(primaryColor,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;
......
......@@ -16,7 +16,11 @@ class VehicleSingleton {
},
"playerEnterVehicle" : (player, vehicle, seat) => {
if (seat === -1) player.call("cVehicle-setFuel", [vehicle.fuel, vehicle.fuelRate]);
if (seat === -1) {
player.call("cVehicle-setFuel", [vehicle.fuel, vehicle.fuelRate])
}else {
return
}
},
"playerExitVehicle" : (player, vehicle, seat) => {
......@@ -80,7 +84,7 @@ class VehicleSingleton {
mp.events.addCommand({
'v' : (player, fullText, model) => {
'v' : (player, fullText, model, color1, color2) => {
if (player.adminLvl < 1) return;
if (!model) return player.notify("Model required");
const d = {
......@@ -95,9 +99,12 @@ class VehicleSingleton {
ownerId: 0,
whoCanOpen: JSON.stringify([player.guid]),
factionName: '',
numberPlate: this.generateRandomNumberPlate(),
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) ]),
numberPlate: 'SCUMBAG1',
// numberPlate: this.generateRandomNumberPlate(),
primaryColor: color1,
secondaryColor: color2,
// 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) ]),
}
const vehicle = new Vehicle(d);
player.putIntoVehicle(vehicle, -1);
......
"use strict"
const player = mp.players.local
// PAINT
// x: 104.129, y: 6622.053, z: 31.486, rot: 43.44
//Mech
//x: 111.08, y: 6626.702, z: 31.444, rot: 41.8
// car repair
//let bodyHealth = vehicle.bodyHealth
//raise car
//entity.setCollision(false, true)
// Map Location
mp.blips.new(524, new mp.Vector3(111.08, 6626.702, 31.444),
{
name: "Carrucan's Customs",
color: 49,
shortRange: true,
scale: 0.75,
})
// Service Class. Tracks where your car is.
class service {
constructor() {
this.garage = ''
this.service = ''
this.primeColor = ''
this.secondaryColor = ''
this.mod = ''
this.engine = ''
this.horn = ''
this.breaks = ''
this.transmission = ''
this.suspension = ''
this.turbo = ''
this.xenon = ''
this.tint = ''
this.plate = ''
this.boost = ''
}
}
// Menu Class. Tracks what Menu to deliver based on which garage slot the users car is in.
class menu {
constructor() {
this.garage = false
this.paint = false
}
}
// Location Class
class colshapeloc {
constructor() {
this.location = ''
}
}
// ColShapes
const colshapeMechanic = mp.colshapes.newSphere(111.08, 6626.702, 31.444, 2.5);
const colshapePaint = mp.colshapes.newSphere(104.129, 6622.053, 31.486, 2.5);
const colshapeDesk = mp.colshapes.newSphere(101.069, 6618.729, 32.435, 1);
// ColShape Functions Entering
function colShapeEntered(player, shape){
// Car is registered into the garage service
if (shape == colshapeMechanic) {
if (player.vehicle) {
service.engine = player.vehicle.getMod(11)
service.horn = player.vehicle.getMod(14)
service.breaks = player.vehicle.getMod(12)
service.transmission = player.vehicle.getMod(13)
service.suspension = player.vehicle.getMod(15)
service.turbo = player.vehicle.getMod(18)
service.xenon = player.vehicle.getMod(22)
service.tint = player.vehicle.getMod(46)
service.plate = player.vehicle.getMod(62)
service.boost = player.vehicle.getMod(40)
player.notify(`Get out and see the mechanic.`)
service.garage = 'ingarage'
}
}
// Car is registered into the paint service
if (shape == colshapePaint) {
if (player.vehicle) {
// Collect details of the vehicle in the garage
service.primeColor = player.vehicle.getColorRGB(0)
service.secondaryColor = player.vehicle.getColorRGB(1)
player.notify(`Get out and see the mechanic.`)
service.garage = 'inpaint'
}
}
// Front desk presents menu based on car location
if (shape == colshapeDesk) {
colshapeloc.location = 'menuactive'
if (service.garage == 'ingarage') {
menu.garage = true
player.notify(`Press ~b~E ~s~to open Mechanic Menu`)
} else if (service.garage == 'inpaint') {
menu.paint = true
player.notify(`Press ~b~E ~s~to open Paint Menu`)
} else {
player.notify(`Yeah? What do you want?`)
}
}
}
// ColShape Functions Leaving
function colShapeExited(player, shape) {
if (shape == colshapeMechanic) {
if (player.vehicle) {
player.notify(`Have a nice day!`)
service.garage = ''
menu.garage = false
}
}
if (shape == colshapePaint) {
if (player.vehicle) {
player.notify(`Have a nice day!`)
service.garage = ''
menu.paint = false
}
}
if (shape == colshapeDesk) {
colshapeloc.location = ''
}
}
// RAGE Event Declarations
mp.events.add("playerEnterColshape", colShapeEntered)
mp.events.add("playerExitColshape", colShapeExited)
mp.events.add({"sKeys-E" : (player) => {
if (colshapeloc.location == 'menuactive') {
if (menu.paint == true) {
player.call("cAutoShop-ShowPaintMenu", service)
}
else if (menu.garage == true) {
//player.notify(`Those custom parts aren't in yet.`)
player.call("cAutoShop-ShowMechanicMenu", service)
}
else {
player.call("cAutoShop-ShowDevMenu")
}
}
else {
return
}
}
})
\ No newline at end of file