Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for (i = 0; i < Object.keys(shop[key]).length; i++) {
  2.         shop1 = shop[key][Object.keys(shop[key])[i]];
  3.         for (a = 0; a < Object.keys(shop1).length; a++) {
  4.             shop2 = shop1[Object.keys(shop1)[a]];
  5.             for (b = 0; b < Object.keys(shop2).length; b++) {
  6.                 shop3 = shop2[Object.keys(shop2)[b]];
  7.                 if("price" in shop3) {
  8.                     mysqlc.mysqlc.query(`SELECT * FROM \`users\` WHERE \`socialclub\`= '${player.socialClub}'`, [], function(err, result) {
  9.                         if(err) {
  10.                             console.log('Error on connection ... ' + err);
  11.                             throw err;
  12.                         }
  13.                         else {
  14.                             unlocked_clothes = JSON.parse(result[0].unlocked_clothes);
  15.                             if(unlocked_clothes.includes(shop3.name)) {
  16.                                 delete shop[key][Object.keys(shop[key])[global.i]][Object.keys(shop1)[global.a]][Object.keys(shop2)[global.b]]['price'];
  17.                             }
  18.                         }
  19.                     });
  20.                 }
  21.             }
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement