Commit 415c67ee authored by Test's avatar Test

complete garage bay framework

parent c9feb59c
......@@ -20,7 +20,7 @@ mp.events.add(
//misc.prepareToCef();
//misc.openCef("package://RP/Business/AutoShop/Mechanic/Paint/paint.html");
//misc.injectCef(inject);
misc.createPointedCam(103.13, 6626.423, 32.828, 0, 0, 0, 80, 102.738, 6623.627, 31.829)
misc.createPointedCam(110.48, 6631.676, 31.787, 0, 0, 0, 80, 109.888, 6626.924, 31.787)
setTimeout(function(){
misc.destroyCam();
},3000)
......@@ -31,8 +31,8 @@ mp.events.add(
// RAGE Object Declarations
//paleto right garage
mp.game.object.doorControl(-822900180, 114, 6623, 32, true, 0, 0, 0);
//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);
//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
"use strict"
const player = mp.players.local;
const player = mp.players.local
// PAINT
// x: 104.129, y: 6622.053, z: 31.486, rot: 43.44
......@@ -12,7 +12,7 @@ const player = mp.players.local;
//let bodyHealth = vehicle.bodyHealth
//raise car
//entity.setCollision(false, true);
//entity.setCollision(false, true)
// Map Location
mp.blips.new(524, new mp.Vector3(111.08, 6626.702, 31.444),
......@@ -21,48 +21,55 @@ mp.blips.new(524, new mp.Vector3(111.08, 6626.702, 31.444),
color: 49,
shortRange: true,
scale: 0.75,
});
// Service Class
})
// Service Class. Tracks where your car is.
class service {
constructor() {
this.garage = '';
this.service = '';
this.garage = ''
this.service = ''
}
}
// Menu Class
// 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;
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, 3);
const colshapePaint = mp.colshapes.newSphere(104.129, 6622.053, 31.486, 3);
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) {
player.notify(`Get out and see the mechanic.`);
service.garage = 'ingarage';
player.notify(`Get out and see the mechanic.`)
service.garage = 'ingarage'
}
}
// Car is registered into the paint service
if (shape == colshapePaint) {
if (player.vehicle) {
player.notify(`Get out and see the mechanic.`);
service.garage = 'inpaint';
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;
menu.garage = true
player.notify(`Press ~b~E ~s~to open Mechanic Menu`)
} else if (service.garage == 'inpaint') {
menu.paint = true;
menu.paint = true
player.notify(`Press ~b~E ~s~to open Paint Menu`)
} else {
player.notify(`Yeah? What do you want?`)
......@@ -73,22 +80,38 @@ function colShapeEntered(player, shape){
function colShapeExited(player, shape) {
if (shape == colshapeMechanic) {
if (player.vehicle) {
player.notify(`Have a nice day!`);
service.garage = 'outgarage';
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 (menu.paint == true) {
player.call("cAutoShop-ShowPaintMenu");
if (colshapeloc.location == 'menuactive') {
if (menu.paint == true) {
player.call("cAutoShop-ShowPaintMenu")
}
if (menu.garage == true) {
//player.notify(`Those custom parts aren't in yet.`)
player.call("cAutoShop-ShowMechanicMenu")
}
}
if (menu.garage == true) {
player.notify(`Those custom parts aren't in yet.`);
// player.call("cAutoShop-ShowMechanicMenu");
else {
return
}
}
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment