Doongogar Posted May 29, 2022 Share Posted May 29, 2022 estou tentando fazer um set id, que sete o id permanentemente, porém toda vez que o player reconecta o id volta ao id comum ja tentei usar o recurso setaccountdata, porém o erro permanece, codigo abaixo: function setID(playerSource,commandName,id, newId) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup ("Console")) then if(id) then local playerID = tonumber(id) if(playerID) then local targetPlayer, targetPlayerName = getPlayerID(playerID) if targetPlayer then local targetAcc = getPlayerAccount(targetPlayer) setAccountData(targetAcc, "ID", newId) setElementData(targetPlayer, "ID", newId) exports.InfoDx:addBox(targetPlayer, "Seu id foi setado para "..newId.." pelo staff: "..getPlayerName(playerSource).."", "info") exports.InfoDx:addBox(playerSource, "Você setou o id do jogador: "..getPlayerName(targetPlayer).." para: "..newId.."", "success") end end end end end addCommandHandler("setid", setID) Link to comment
DaeRoNz Posted May 31, 2022 Share Posted May 31, 2022 addEventHandler( 'onPlayerLogin', getRootElement(), function ( _, acc ) local IDplayer = getAccountData(acc, "ID") setElementData(source, "ID", IDplayer) end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now