MisterZ Posted January 12, 2015 Share Posted January 12, 2015 Como puedo hacer para que una ves que se registre no pueda cambiar mas su Nick por mas que use el conando /Nick o lo cambie de la interfaz de su MTA no le cambie el Nick en el server. Gracias. Link to comment
Castillo Posted January 12, 2015 Share Posted January 12, 2015 https://wiki.multitheftauto.com/wiki/OnPlayerChangeNick Podes intentar cancelar ese evento. Link to comment
MisterZ Posted January 12, 2015 Author Share Posted January 12, 2015 Vale Gracias Soli ya me funciono addEventHandler("onPlayerChangeNick", getRootElement(), function () cancelEvent() end) Link to comment
MisterZ Posted January 12, 2015 Author Share Posted January 12, 2015 Un problema si salgo del sv y me cambio el nombre entro y si se cambia yo quiero que no lo puedan cambiar una ves que se registre que ago ? Link to comment
Castillo Posted January 12, 2015 Share Posted January 12, 2015 Tendrias que guardar el nombre que uso al registrarse en alguna parte, podria ser en accountData ( setAccountData/getAccountData ), y al loguearse, que lo obtenga y se lo cambie ( setPlayerName ). Link to comment
MisterZ Posted January 12, 2015 Author Share Posted January 12, 2015 Tengo que usar esto ? addEventHandler("onPlayerRegister", getRootElement(), function () setAccountData() end end) addEventHandler("onPlayerLogin", root, function (prev,act) local data = getAccountData(act,) if data then setAccountData() setPlayerName() end end) Link to comment
Plate Posted January 13, 2015 Share Posted January 13, 2015 Eso esta terriblemente mal addEventHandler("onPlayerRegister", getRootElement(), function () setAccountData(getPlayerAccount(source), "Nickname", getPlayerName(source)) end end) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 Eso esta terriblemente mal addEventHandler("onPlayerRegister", getRootElement(), function () setAccountData(getPlayerAccount(source), "Nickname", getPlayerName(source)) end end) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) No sirve Link to comment
Alexs Posted January 13, 2015 Share Posted January 13, 2015 No sirve porque no existe ningún evento llamado 'onPlayerRegister'. Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 No sirve porque no existe ningún evento llamado 'onPlayerRegister'. ha ya vale entonces lo pndre en el server del panel login dentro de la función donde registra hay funcionara ? Link to comment
Alexs Posted January 13, 2015 Share Posted January 13, 2015 No sirve porque no existe ningún evento llamado 'onPlayerRegister'. ha ya vale entonces lo pndre en el server del panel login dentro de la función donde registra hay funcionara ? Si, eso debería funcionar. Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 Lo hice haci pro no funciona function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(source), "Nickname", getPlayerName(source)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) Me registro me salgo cambio el Nick y si se cambia Link to comment
Alexs Posted January 13, 2015 Share Posted January 13, 2015 En la cuarta linea de tu código, cambia 'source' por 'player'. Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 En la cuarta linea de tu código, cambia 'source' por 'player'. No Hay Caso Alexs function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(player), "Nickname") if data then setPlayerName(player, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Link to comment
Tomas Posted January 13, 2015 Share Posted January 13, 2015 function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(player, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(player, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Nada será que le puedes implementar el registro por serial ? si puedes sino deja. pero lo del name no anda Link to comment
Tomas Posted January 13, 2015 Share Posted January 13, 2015 Encontré otro error. function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 Encontré otro error. function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) que mal esto no funciona Link to comment
Tomas Posted January 13, 2015 Share Posted January 13, 2015 function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) addEventHandler("onPlayerLogin", root, function () local data = getAccountData(getPlayerAccount(source), "Nickname") if data then setPlayerName(source, data) end end) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) me salgo del server cambio el name entro y se cambio Link to comment
Plate Posted January 13, 2015 Share Posted January 13, 2015 Algo que seria muy util es que pongas /debugscript 3 dentro del juego y nos digas los errores que te da el script EDIT: Intenta esto function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) local data = getAccountData(getPlayerAccount(player), "Nickname") if data then setPlayerName(player, data) end else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Link to comment
MisterZ Posted January 13, 2015 Author Share Posted January 13, 2015 Algo que seria muy util es que pongas /debugscript 3 dentro del juego y nos digas los errores que te da el scriptEDIT: Intenta esto function register_func ( player, username, passwort) local acc = addAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFTe Haz Registrado Con Exito!",player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) setAccountData(getPlayerAccount(player), "Nickname", getPlayerName(player)) else outputChatBox("[ERROR]: #FFFFFFPonte En Contacto Con Algun Administrador!!",player, 255, 0, 0, true) end end addEvent("register",true) addEventHandler("register",getRootElement(),register_func) function login_func ( player, username, passwort) local acc = getAccount(username,passwort) if acc then logIn(player,acc,passwort) outputChatBox("[sERVER]: #FFFFFFHaz Iniciado Secion Con Exito!",player, 0, 255, 0, true) outputChatBox("Bienvenido #FFFFFF"..getPlayerName(player),player, 0, 255, 0, true) triggerClientEvent(player,"closeLoginPanel",player) local data = getAccountData(getPlayerAccount(player), "Nickname") if data then setPlayerName(player, data) end else outputChatBox("[ERROR]: #FFFFFFTu Contraseña o Usuario Es Incorrecto!!",player, 255, 0, 0, true) end end addEvent("login",true) addEventHandler("login",getRootElement(),login_func) Vale Gracias Ha Los 2 ahora funciona PD: Plate me ayudarías hacer la registración por serial ? solo me falta eso Link to comment
Recommended Posts