Fixed decimal exploit, cleanup

This commit is contained in:
ElPumpo
2018-06-09 18:25:50 +02:00
parent 296ce29534
commit f4291d1564
13 changed files with 57 additions and 62 deletions
+36 -43
View File
@@ -1,50 +1,43 @@
$(window).ready(function () {
// NUI Callback
window.addEventListener('message', function (event) {
let data = event.data;
if (data.showControls) {
$('#container').show();
$('#menu').hide();
}
if (data.showMenu) {
$('#container').show();
$('#menu').show();
$('#deposit_amount').val(data.player.money);
let bankAmount = 0;
for (let i = 0; i < data.player.accounts.length; i++)
if (data.player.accounts[i].name == 'bank')
bankAmount = data.player.accounts[i].money;
if (bankAmount >= 10000) {
$('#withdraw_amount').val(10000);
} else {
$('#withdraw_amount').val(bankAmount);
}
}
// NUI Callback
window.addEventListener('message', function (event) {
let data = event.data;
if (data.hideAll) {
$('#container').hide();
}
});
if (data.showMenu) {
$('#container').fadeIn();
$('#menu').fadeIn();
$('#deposit_amount').val(data.player.money);
let bankAmount = 0;
for (let i = 0; i < data.player.accounts.length; i++) {
if (data.player.accounts[i].name == 'bank') {
bankAmount = data.player.accounts[i].money;
}
}
$('#withdraw_amount').val(bankAmount);
} else if (data.hideAll) {
$('#container').fadeOut();
}
});
document.onkeyup = function (data) {
if (data.which == 27) {
$.post('http://esx_atm/escape', '{}');
}
};
document.onkeyup = function (data) {
if (data.which == 27) {
$.post('http://esx_atm/escape', '{}');
}
};
$('#container').hide();
$('#container').hide();
$('#deposit_btn').on('click', function () {
$.post('http://esx_atm/deposit', JSON.stringify({
amount: $('#deposit_amount').val()
}));
})
$('#deposit_btn').on('click', function () {
$.post('http://esx_atm/deposit', JSON.stringify({
amount: $('#deposit_amount').val()
}));
$('#deposit_amount').val(0);
})
$('#withdraw_btn').on('click', function () {
$.post('http://esx_atm/withdraw',
JSON.stringify({
amount: $('#withdraw_amount').val()
})
);
});
$('#withdraw_btn').on('click', function () {
$.post('http://esx_atm/withdraw', JSON.stringify({
amount: $('#withdraw_amount').val()
}));
$('#withdraw_amount').val(0);
});
});