daniels Posted June 1, 2020 Share Posted June 1, 2020 ola eu gostaria de saber como faço para mudar o id dos players,não sei mexer com scripts,o meu script de id é esse: function Start_Id ( _, acc ) if eventName == "onPlayerLogin" then setElementData ( source, "ID", getAccountID(acc) or "N/A" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true) elseif eventName == "onPlayerLogout" then removeElementData( source, "ID" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true) elseif eventName == "onResourceStart" then for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setElementData( source, "ID", getAccountID(acc) or "N/A" ) end end end end addEventHandler("onResourceStart", resourceRoot, Start_Id) addEventHandler("onPlayerLogout", root, Start_Id) addEventHandler("onPlayerLogin", root, Start_Id) função getPlayerID (id) v = false para i, player em ipairs (getElementsByType ("player")) faz se getElementData (player, "ID") == id em seguida v = player break end end return v end - === ==================================================== ==================================================== ===================== - - =========================== ==== - ----------- ID PLAYER ------------ - ================= ============ - função getnick (jogador, comando, id, ...) if (id) então local playerID = número (id) if (playerID) e local Player2 = getPlayerID (playerID) se (Player2) e outputChatBox ("# 00ff00✘ #ffffffINFO # 00ff00✘➺ #ffffff Nome do jogador # 00ff00" .. getPlayerName (player2) .. "", player, 255.255.255, verdadeiro) else outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff O Jogador (a) de ID: # 00ff00 (" .. id .. ") # ffffff Não foi encontrado! ", player, 255.255.255, verdadeiro) end else outputChatBox (" # 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff ID: # 00ff00 (".. id ..") # ffffffInválido! ", player, 255.255.255,verdadeiro) fim mais outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffffUse / id # 00ff00 [# ffffffID # 00ff00]", player, 255.255.255, true) end end addCommandHandler ("id", getnick) alguem pode me ajudar? Link to comment
zW1Z4RD Posted June 6, 2020 Share Posted June 6, 2020 On 01/06/2020 at 17:57, [email protected] said: ola eu gostaria de saber como fazer para mudar o id dos jogadores, não sei mexer com scripts, ou o meu script de id é esse: função Start_Id (_, acc) se eventName == "onPlayerLogin" e setElementData (origem, "ID", getAccountID (acc) ou "N / A") outputChatBox ("# 00ff00✘ #ffffffLOGIN # 00ff00✘➺ #ffffffNick: # 00ff00 (".. getPlayerName (origem) .." # 00ff00) #ffffffID: # 00ff00 (".. (getAccountID (acc) ou" N / A ") ..") ", raiz, 255.255.255, true) elseif eventName == "onPlayerLogout" e removeElementData (origem, "ID") outputChatBox ("# 00ff00✘ #ffffffLOGIN # 00ff00✘➺ #ffffffNick: # 00ff00 (" .. getPlayerName (fonte) .. "# 00ff00) #ffffffDeslogou.", raiz, 255.255.255, verdade) elseif eventName == "onResourceStart"depois, para _, player em pares (getElementsByType ("player")) faça acc local = getPlayerAccount (player) se não for isGuestAccount (acc) e setElementData (origem, "ID", getAccountID (acc) ou "N / A") fim fim fim fim fim addEventHandler ("onResourceStart", resourceRoot, Start_Id) addEventHandler (" onPlayerLogout ", raiz, Start_Id) addEventHandler (" onPlayerLogin ", raiz, Start_Id) função getPlayerID (id) v = false para i, player em ipairs (getElementsByType ("player")) torna getElementData (player, "ID") == id em seguida v = player break end end return v end - === ==================================================== == ================================================== ==== ===================== - - ========================= ==== ==== - ----------- ID PLAYER ------------ - ================= == ============ - função getnick (jogador, comando, id, ...) if (id) então local playerID = número (id) se (playerID) e local Player2 = getPlayerID (playerID) se (Player2) e outputChatBox ("# 00ff00✘ #ffffffINFO # 00ff00✘➺ #ffffff Nome do jogador # 00ff00" .. getPlayerName (player2) .. "", player, 255.255.255, verdadeiro) else outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff O Jogador (a) de ID: # 00ff00 (" .. id .. ") # ffffff Não foi encontrado! ", player, 255.255.255, verdadeiro) end else outputChatBox (" # 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff ID: # 00ff00 (".. id ..") # ffffffInválido! ", player, 255.255 .255,verdadeiro) fim mais outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffffUse / id # 00ff00 [# ffffffID # 00ff00]", player, 255.255.255, true) end end addCommandHandler ("id", getnick) alguem pode me ajudar? O ID é gerado por registros caso o seu servidor tiver 20 contas registradas o ID do ultimo player que se registrou será 20 e etc Link to comment
MrKAREEM Posted June 7, 2020 Share Posted June 7, 2020 On 02/06/2020 at 00:57, [email protected] said: ola eu gostaria de saber como faço para mudar o id dos players,não sei mexer com scripts,o meu script de id é esse: function Start_Id ( _, acc ) if eventName == "onPlayerLogin" then setElementData ( source, "ID", getAccountID(acc) or "N/A" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true) elseif eventName == "onPlayerLogout" then removeElementData( source, "ID" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true) elseif eventName == "onResourceStart" then for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setElementData( source, "ID", getAccountID(acc) or "N/A" ) end end end end addEventHandler("onResourceStart", resourceRoot, Start_Id) addEventHandler("onPlayerLogout", root, Start_Id) addEventHandler("onPlayerLogin", root, Start_Id) função getPlayerID (id) v = false para i, player em ipairs (getElementsByType ("player")) faz se getElementData (player, "ID") == id em seguida v = player break end end return v end - === ==================================================== ==================================================== ===================== - - =========================== ==== - ----------- ID PLAYER ------------ - ================= ============ - função getnick (jogador, comando, id, ...) if (id) então local playerID = número (id) if (playerID) e local Player2 = getPlayerID (playerID) se (Player2) e outputChatBox ("# 00ff00✘ #ffffffINFO # 00ff00✘➺ #ffffff Nome do jogador # 00ff00" .. getPlayerName (player2) .. "", player, 255.255.255, verdadeiro) else outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff O Jogador (a) de ID: # 00ff00 (" .. id .. ") # ffffff Não foi encontrado! ", player, 255.255.255, verdadeiro) end else outputChatBox (" # 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffff ID: # 00ff00 (".. id ..") # ffffffInválido! ", player, 255.255.255,verdadeiro) fim mais outputChatBox ("# 00ff00✘ #ffffffERRO # 00ff00✘➺ #ffffffUse / id # 00ff00 [# ffffffID # 00ff00]", player, 255.255.255, true) end end addCommandHandler ("id", getnick) alguem pode me ajudar? porquê programar códigos na língua portugal ? como estas linhas: função getPlayerID (id) v = false para i, player em ipairs (getElementsByType ("player")) faz se getElementData (player, "ID") == id em seguida v = player break end end return v end Link to comment
Giovany Mito Posted June 7, 2020 Share Posted June 7, 2020 Esse script esta na internet para download NESSE LINK Creio que não seja possivel você alterar o id do player, se caso nao queira o id fixo do player você pode puxa o id temporario do server 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