Vrael 0 Posted October 21 Hello, i found a tutorial here for a login script and im trying to get it working. Client-side: Spoiler var loginBrowser = mp.browsers.new('package://Login/Login.html'); mp.gui.cursor.show(true, true); mp.events.add('loginInformationToServer', (username, password) => { mp.events.callRemote('OnPlayerLoginAttempt', username, password); }); now i try to catch the username and password wich was send to the server by trying this: Spoiler mp.events.add("OnPlayerLoginAttempt", username, password => { console.log("Username: " + username, "Passwort: " + password ); }); the first problem is, when i start the server i do get this errors: Spoiler Error: ReferenceError: username is not defined at Object.<anonymous> (C:\RAGEMP\server-files\packages\****\events\OnPlayerLogin.js:1:102) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (C:\RAGEMP\server-files\packages\****\index.js:8:1) at Module._compile (internal/modules/cjs/loader.js:689:30) why do i always get these kind of "is not defined" errors? Share this post Link to post Share on other sites
Xabi 142 Posted October 22 You are missing the parenthesis on server params (username, password) Share this post Link to post Share on other sites
Vrael 0 Posted October 25 Am 22.10.2019 um 07:48 schrieb Xabi: You are missing the parenthesis on server params (username, password) what do u exactly mean? and how do i need to do it? Share this post Link to post Share on other sites
MrPancakers 108 Posted October 25 2 minutes ago, Vrael said: what do u exactly mean? and how do i need to do it? He wrote how to do it, needs to be (username, password) and not just username, password mp.events.add("OnPlayerLoginAttempt", (username, password) => { Share this post Link to post Share on other sites
Vrael 0 Posted October 25 vor 18 Stunden schrieb MrPancakers: He wrote how to do it, needs to be (username, password) and not just username, password mp.events.add("OnPlayerLoginAttempt", (username, password) => { Oh now i get it. Share this post Link to post Share on other sites