Jump to content

i cannot send password from client to server


TedyRO

Recommended Posts

So, today i tried to take a step forward with my server and make an interface for it, to be more exact a login interface, but i encountered a problem. When i send data from interface ".js" file to client, it gets the data perfectly, but every time when i try to send it to the server i get:

mp.events.add("LoginClientSide", (pass) => {
    mp.console.logInfo(pass)
    mp.events.callRemote("Login", mp.players.local.name.toLowerCase(), pass)
})

// return { __pandingRpc: {} }

I tried to google the issue, but i found no result, if some one can help me i'll appreciate it!

main.js from interface

	$("#loginButton").click(() => {
		mp.trigger("LoginClientSide", document.getElementById("loginPasswordText").value);
	})

Server.js

mp.events.add("Login", async(pass, name) => {
  console.log(name,pass)
})

FIXED
The problem was this line:
 

mp.events.add("Login", async(pass, name) => {
  console.log(name,pass)
})

And all i needed to do is:

mp.events.add("Login", async(player, name, pass) => { // player is a required arg
  console.log(name,pass)
})

 

 

Edited by TedyRO
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...