Jump to content

Login script


Recommended Posts


i found a tutorial here for a login script and im trying to get it working.


var loginBrowser = mp.browsers.new('package://Login/Login.html');
mp.events.add('loginInformationToServer', (usernamepassword=> {


now i try to catch the username and password wich was send to the server by trying this:

mp.events.add("OnPlayerLoginAttempt"usernamepassword => {
console.log("Username: " + username"Passwort: " + password );


the first problem is, when i start the server i do get this errors:


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?



Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...