zW1Z4RD Posted July 7, 2020 Share Posted July 7, 2020 (edited) Tentei fazer esse script de /ve ID. Ver o dinheiro q o player com o certo ID tem Porem não esta dando certo function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function getnick(player, command, id, ...) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then local Dinheiro = getPlayerMoney(Player2) setElementData(player, "Suspeito:Dinheiro",Dinheiro) if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. Dinheiro .."", player, 255,255,255,true) else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /ve #00ff00[#ffffffID#00ff00]", player, 255,255,255,true) end end end addCommandHandler("ve", getnick) Edited July 7, 2020 by zW1Z4RD Link to comment
ber Posted July 7, 2020 Share Posted July 7, 2020 Não testei mas creio que funcione: function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function verMoney(player, command, id, ...) if hasObjectPermissionTo("player", "command.ban") == false then return end if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then local money = getPlayerMoney(Player2) outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true) end end end end addCommandHandler("ve", verMoney) Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor. Link to comment
Blaack Posted July 7, 2020 Share Posted July 7, 2020 2 hours ago, ber said: Não testei mas creio que funcione: function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function verMoney(player, command, id, ...) if hasObjectPermissionTo("player", "command.ban") == false then return end if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then local money = getPlayerMoney(Player2) outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true) end end end end addCommandHandler("ve", verMoney) Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor. Creio eu, que o "player" na linha 13, tem de ser fora das aspas (" ") Link to comment
zW1Z4RD Posted July 7, 2020 Author Share Posted July 7, 2020 (edited) 4 hours ago, ber said: Não testei mas creio que funcione: function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function verMoney(player, command, id, ...) if hasObjectPermissionTo("player", "command.ban") == false then return end if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then local money = getPlayerMoney(Player2) outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true) end end end end addCommandHandler("ve", verMoney) Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor. Esta dando error na linha 24 Edit: Arrumei Edited July 7, 2020 by zW1Z4RD 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