Commit 36e2ee4c authored by Test's avatar Test

update auto-shop

parent d2e2bb48
Pipeline #84 failed with stages
in 0 seconds
......@@ -16,7 +16,7 @@
</div>
<div class="error-message" v-if="errorMessage">{{ errorMessage }}</div>
<div class="error-message" style="background: limegreen;" v-if="infoMessage">{{ infoMessage }}</div>
<div class="top-button" style="right: 0; left: auto;" @click="goToRegWindow">Create new account</div>
<div class="top-button" style="right: 0; left: auto;" @click="goToRegWindow">Create new account</div>
</section>
</section>
</body>
......
......@@ -20,7 +20,7 @@
</span>
<span v-if="mailChecked && nameChecked">
<input type="text" class="textinput" placeholder="Password" v-model="enteredPass1" :class="{ checked: passChecked }">
<input type="password" class="textinput" placeholder="Password" v-model="enteredPass1" :class="{ checked: passChecked }">
<input type="text" class="textinput" placeholder="Confirm password" v-model="enteredPass2" @input="verifyPass" :class="{ checked: passChecked }">
</span>
......
......@@ -100,13 +100,22 @@ class RegiserSingleton extends AbstractAuth {
const regiserSingleton = new RegiserSingleton();
mp.events.add({
"playerReady" : async (player) => {
"playerJoin" : async (player) => {
player.spawn(new mp.Vector3(3222, 5376, 20));
player.alpha = 0;
player.dimension = 1001;
playerSingleton.loadPlayerTemplate(player);
player.call("cLogin-ShowLoginWindow");
},
// "playerReady" : async (player) => {
// player.spawn(new mp.Vector3(3222, 5376, 20));
// player.dimension = 1001;
// playerSingleton.loadPlayerTemplate(player);
// player.call("cLogin-ShowLoginWindow");
// },
"sRegister-TryGetCodeToRegister" : async (player, email) => {
regiserSingleton.tryGetCodeToRegister(player, email);
},
......
......@@ -42,7 +42,6 @@ class PlayerSingleton {
player.health = d[0].health;
player.call("cCloseCefAndDestroyCam");
const q1 = moneySingleton.loadUser(player);
const q2 = characterSingleton.loadPlayerBody(player);
const q3 = clothesSingleton.loadPlayerClothes(player);
......
......@@ -31,10 +31,12 @@ async function loadShops() {
new CheapCarDealership(d[i]);
}
}
loadShops();
mp.events.addCommand({
'createcheapcardealership' : async (player, enteredprice) => {
if (player.adminLvl < 1) return;
const id = business.getCountOfBusinesses() + 1;
......
......@@ -95,14 +95,24 @@ mp.events.addCommand({
const price = Number(enteredprice.replace(/\D+/g,""));
const query1 = misc.query(`INSERT INTO business (id, title, coord, price) VALUES ('${id}', 'Clothing Shop', '${coord}', '${price}');`);
const query2 = misc.query(`INSERT INTO clothingshop (id) VALUES ('${id}');`);
await Promise.all([query1, query2]);
try {
await Promise.all([query1, query2]);
}
catch(err){
player.outputChatBox("Something went wrong!");
}
player.outputChatBox("!{#4caf50} Clothing shop successfully created!");
},
'setchbuyerstandcoord' : async (player, id) => {
if (player.adminLvl < 1) return;
const coord = misc.getPlayerCoordJSON(player);
await misc.query(`UPDATE clothingshop SET buyerStandCoord = '${coord}' WHERE id = ${id}`);
try{
await misc.query(`UPDATE clothingshop SET buyerStandCoord = '${coord}' WHERE id = ${id}`);
}
catch(err){
player.outputChatBox("Something went wrong!");
}
player.notify(`~g~${i18n.get('basic', 'success', player.lang)}!`);
},
......
{
"keep": {
"days": true,
"amount": 30
},
"auditLog": "logs/.audit.json",
"files": [
{
"date": 1545594281109,
"name": "logs\\2018-12-23.log",
"hash": "69979b43e7697720765800448e862247"
}
]
}
\ 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