Столкнулся с проблемой, что player.TriggerEvent просто не передает информацию, тоесть не вызывает даже функцию.
Client-Side:
Server-Side:
Client-Side:
C#:
[Command("addAccount")]
public void CreateAccount(Player player, string social, string nickName, string Password, string Email, int RecoveryCode)
{
player.TriggerEvent("SendMySQL", social, nickName, Password, Email, RecoveryCode);
}
Server-Side:
JavaScript:
mp.events.add("SendMySQL", (social, nick, pass, email, recovcode) => {
connection.query(`INSERT INTO accounts (SocialClubID, Nick, Password, Email, RecoveryCode) VALUES ('${social}', '${nick}', '${pass}', '${email}', '${recovcode}')`, function (error, results) {
console.log(results);
if (error) {
console.log(error);
}
});
});