tonihenkel Posted April 18, 2019 Share Posted April 18, 2019 (edited) Hi, I build aATM Broser and will execute a Variable from .js-File to the ATM Browser (Pocket Money and Bank Money), but it doesn't work client_package/BANK/index.js: [..] function openCef(url) { if (cef) cef.destroy(); cef = mp.browsers.new(url); cef.execute(`money_bank=200; money_pocket=400;`); } exports.openCef = openCef; openCef(index.html); [..] html-file: [..] <td class="infobox_table"><center>Bank<br><script type="text/javascript">document.write(" " + money_bank + " $");</script></td> [..] I test this and works, but no with the variables: cef.execute(`alert(\`It's a test.\`);`) Edited April 19, 2019 by tonihenkel Link to comment Share on other sites More sharing options...
tonihenkel Posted April 20, 2019 Author Share Posted April 20, 2019 Nobody can help me ? Link to comment Share on other sites More sharing options...
zsolo99 Posted April 20, 2019 Share Posted April 20, 2019 (edited) If I were you, I would pass the variables through the function. function openCef(url, money_bank, money_pocket) So you could create a function which upgrades the value in the html for example with innerHTML https://www.w3schools.com/jsref/prop_html_innerhtml.asp Edited April 20, 2019 by zsolo99 Link to comment Share on other sites More sharing options...
tonihenkel Posted April 22, 2019 Author Share Posted April 22, 2019 (edited) Mhh ok, I set: Zitat let money_pocket = `money_pocket = 1200;`; let money_bank = `money_bank = 1200;`; openCef("bank/index.html", money_pocket, money_bank); I'm a beginner.I need asimple injection of the current Money Bank and Money Pocket for the Websiten and auto-update this money, when the money chaneged background and ARTM Browser is open (Daily payment or Player Transfer) Look at this, this is the HTML Page http://prntscr.com/nf5fpc Zitat https://www.w3schools.com/jsref/prop_html_innerhtml.asp This inner example is a button event Edited April 22, 2019 by tonihenkel Link to comment Share on other sites More sharing options...
joew Posted April 22, 2019 Share Posted April 22, 2019 (edited) Unfortunately there aren't any simple way to make things. You need to code all by yourself or you can use scripts already done. You can use JS + Vue, you can use js + react, you can use c# ... There are a lot you can do to make the systems you want. One very nice script is the menu builder: It's client side, but you can use Events::callRemote to call a server-side event from a client-side script: https://wiki.rage.mp/index.php?title=Events::callRemote There are one starter project with Vue (by MarkCavalli: https://rage.mp/profile/19144-markcavalli/)https://github.com/MarkCavalli/rage-server-start-template I found today a nice guide: Edited April 23, 2019 by joew 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now