1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| var drawAnimation = false;
var currentMoney = null;
var currentIMoney = null;
var res = API.getScreenResolution();
var screenOpacity = 255;
API.onUpdate.connect(function (sender, args) {
if (drawAnimation) {
API.drawText("Appuie sur F pour stopper l'animation", res.Width - 30, res.Height - 100, 0.5, 255, 186, 131, 255, 4, 2, false, true, 0);
}
if (currentMoney != null) {
API.drawText("$" + currentMoney, res.Width - 15, 50, 1, 115, 186, 131, 255, 4, 2, false, true, 0);
}
if (currentMoney != null) {
API.drawText("$" + currentMoney, res.Width - 15, 100, 0.9, 232, 44, 23, 255, 4, 2, false, true, 0);
}
if (screenOpacity != 255) {
API.drawRectangle(0, 0, res.Width, res.Height, 0, 0, 0, screenOpacity);
}
});
API.onServerEventTrigger.connect(function (eventName, args) {
if (eventName === "refresh_money") {
currentMoney = Number(args[0]).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
else if (eventName === "refresh_imoney") {
currentMoney = Number(args[0]).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
else if (eventName === "screenOpacity") {
screenOpacity = args[0];
}
else if (eventName === "animation_notification") {
drawAnimation = !drawAnimation;
}
}); |
Partager