Postado Março 1, 2021 4 anos Olá, gostaria de um sistema de baú donate, onde a pessoa faz o donate, e eu como adm entro no game e coloco os pontos(itens) nesse baú, e somente essa pessoa que eu determinei que vai poder retirar esses itens. Esse baú vai funcionar para todos os player mas somente os que eu determinar os itens que poderão retirar. Desde já agradeço Meu tfs é 0.4 Ate disponibilizaria algum código para facilitar mas não faço a menor ideia qual codigo se aproxima mais disso Ja vi esse sistema funcionando no Wodbo Wars
Postado Março 3, 2021 4 anos Acredito que em tfs 0.4 não de pra fazer, o que você pode fazer é um comando que da X Quantia de storage ao player (Que seria os pontos), e quando ele apertar o bau, checar essa storage, se a storage tiver valor 10, ele recebe os 10 pontos no depot dele, ou alterando a talk /i pra setar um atributo com o nome do player, ai vc cria o item com nome joga no bau, esse bau depois de um tempo checa os item e manda pro depois dos players que tem o nome igual do atributo do item Editado Março 5, 2021 4 anos por FlameArcixt (veja o histórico de edições)
Postado Março 5, 2021 4 anos Solução Em talkactions/scripts crie uma arquivo chamado addpoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else setPlayerStorageValue(tid, 15555, getPlayerStorageValue(cid, 15555) + t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou " .. t[2] .. " points " .. "para " .. t[1].. ".") doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu " .. t[2] .. " points.") doSendAnimatedText(getPlayerPosition(tid), "+" .. t[2] .. " points.", COLOR_DARKYELLOW) end return true end -- /teste yeths, valor em talkactions/scripts ainda, crie um arquivo chamado removepoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else if (getPlayerStorageValue(tid, 15555) - t[2]) < 0 then setPlayerStorageValue(tid, 15555, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu todos os points do jogador " .. t[1].. ".") return true end setPlayerStorageValue(tid, 15555, getPlayerStorageValue(tid, 15555) - t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu " .. t[2] .. " points do jogador " .. t[1].. ".") end return true end -- /teste yeths, valor em talkactions/scripts ainda crie um arquivo chamado getpoints.lua e cole \/ function onSay(cid, words, param) local tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este jogador possui " .. getPlayerStorageValue(tid, 15555) .. " points.") return true end -- /teste yeths, valor agora em talkactions.xml coloque essas tags <!-- points --> <talkaction words="/addpoints" event="script" value="addpoints.lua"/> <talkaction words="/removepoints" event="script" value="removepoints.lua"/> <talkaction words="/obterpoints" event="script" value="getpoints.lua"/> em actions/scripts crie um arquivo chamado bau_points.lua info_table = { id_points = 2260 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 15555) >= 1 then data = os.date("%d/%m/%y", os.time()) timer = os.date("%H:%M:%S", os.time()) local test = io.open("points.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end read = read.."Dia: " .. data .. " hora:" .. timer .. " nome do jogador: "..getCreatureName(cid).. ", valor retirado: " ..getPlayerStorageValue(cid, 15555).." points.\n" local reopen = io.open("points.txt", "w") reopen:write(read) reopen:close() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu +" .. getPlayerStorageValue(cid, 15555) .. " points.") doPlayerAddItem(cid, info_table.id_points, getPlayerStorageValue(cid, 15555)) setPlayerStorageValue(cid, 15555, 0) else return doPlayerSendCancel(cid, "Você não possui points.") end end agora em actions.xml coloque essas tags <!-- points --> <action actionid="ACTIONSID" event="script" value="bau_points.lua"/> ultimo passo, vai em creaturescript/scripts e procure por login.lua if getPlayerStorageValue(cid, 15555) == -1 then setPlayerStorageValue(cid, 15555, 0) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce possui " .. getPlayerStorageValue(cid, 15555) .. " points.") oque esse script irá fazer, ele te permite dar points para o jogador, te permite retirar os points do jogador, te permite olhar quantos pontos o jogador possui. além de coisas banais como, ao adicionar points no jogador, irá aparecer no player {+quantida adicionada} isso também irá criar um arquivo no sua pastar do executavel do seu servidor, dizendo quem pegou e quanto tirou de lá!. exemplo: Spoiler Dia: 01/03/21 hora:17:40:02 nome do jogador: Fellipe, valor retirado: 1 points Dia: 01/03/21 hora:17:42:06 nome do jogador: Fellipe, valor retirado: 10 points Dia: 02/03/21 hora:10:24:02 nome do jogador: Fellipe, valor retirado: 12 points como usar? /addpoints nomedojogardor, quantia de points /removepoints nomedojogador, quantia a ser retirada /obterpoints nomedojogador @Nother este script foi criado para um servidor de um amigo, então está 100% creditos totalmente meu! espero o seu feedback. Editado Março 5, 2021 4 anos por Sun (veja o histórico de edições) Have no idea! freelance? go to my discord: sun#8860
Postado Março 5, 2021 4 anos Autor 1 hora atrás, Sun disse: Em talkactions/scripts crie uma arquivo chamado addpoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else setPlayerStorageValue(tid, 15555, getPlayerStorageValue(cid, 15555) + t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou " .. t[2] .. " points " .. "para " .. t[1].. ".") doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu " .. t[2] .. " points.") doSendAnimatedText(getPlayerPosition(tid), "+" .. t[2] .. " points.", COLOR_DARKYELLOW) end return true end -- /teste yeths, valor em talkactions/scripts ainda, crie um arquivo chamado removepoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else if (getPlayerStorageValue(tid, 15555) - t[2]) < 0 then setPlayerStorageValue(tid, 15555, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu todos os points do jogador " .. t[1].. ".") return true end setPlayerStorageValue(tid, 15555, getPlayerStorageValue(tid, 15555) - t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu " .. t[2] .. " points do jogador " .. t[1].. ".") end return true end -- /teste yeths, valor em talkactions/scripts ainda crie um arquivo chamado getpoints.lua e cole \/ function onSay(cid, words, param) local tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este jogador possui " .. getPlayerStorageValue(tid, 15555) .. " points.") return true end -- /teste yeths, valor agora em talkactions.xml coloque essas tags <!-- points --> <talkaction words="/addpoints" event="script" value="addpoints.lua"/> <talkaction words="/removepoints" event="script" value="removepoints.lua"/> <talkaction words="/obterpoints" event="script" value="getpoints.lua"/> em actions/scripts crie um arquivo chamado bau_points.lua info_table = { id_points = 2260 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 15555) >= 1 then data = os.date("%d/%m/%y", os.time()) timer = os.date("%H:%M:%S", os.time()) local test = io.open("points.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end read = read.."Dia: " .. data .. " hora:" .. timer .. " nome do jogador: "..getCreatureName(cid).. ", valor retirado: " ..getPlayerStorageValue(cid, 15555).." points.\n" local reopen = io.open("points.txt", "w") reopen:write(read) reopen:close() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu +" .. getPlayerStorageValue(cid, 15555) .. " points.") doPlayerAddItem(cid, info_table.id_points, getPlayerStorageValue(cid, 15555)) setPlayerStorageValue(cid, 15555, 0) else return doPlayerSendCancel(cid, "Você não possui points.") end end agora em actions.xml coloque essas tags <!-- points --> <action actionid="ACTIONSID" event="script" value="bau_points.lua"/> ultimo passo, vai em creaturescript/scripts e procure por login.lua if getPlayerStorageValue(cid, 15555) == -1 then setPlayerStorageValue(cid, 15555, 0) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce possui " .. getPlayerStorageValue(cid, 15555) .. " points.") oque esse script irá fazer, ele te permite dar points para o jogador, te permite retirar os points do jogador, te permite olhar quantos pontos o jogador possui. além de coisas banais como, ao adicionar points no jogador, irá aparecer no player {+quantida adicionada} isso também irá criar um arquivo no sua pastar do executavel do seu servidor, dizendo quem pegou e quanto tirou de lá!. exemplo: Ocultar conteúdo Dia: 01/03/21 hora:17:40:02 nome do jogador: Fellipe, valor retirado: 1 points Dia: 01/03/21 hora:17:42:06 nome do jogador: Fellipe, valor retirado: 10 points Dia: 02/03/21 hora:10:24:02 nome do jogador: Fellipe, valor retirado: 12 points como usar? /addpoints nomedojogardor, quantia de points /removepoints nomedojogador, quantia a ser retirada /obterpoints nomedojogador @Nother este script foi criado para um servidor de um amigo, então está 100% creditos totalmente meu! espero o seu feedback. Fiz as adições, mas tive um problema, mostra que o player recebeu os points mas quando tento retirar no bau ou falar getpoints fala que ele está zerado. E no meu caso os points não seriam dessa forma. Eles são uma moeda no jogo que pode ser comercializada. E o player só pegaria essas moedas quando fosse no bau entende?
Postado Março 5, 2021 4 anos 2 minutos atrás, Nother disse: Fiz as adições, mas tive um problema, mostra que o player recebeu os points mas quando tento retirar no bau ou falar getpoints fala que ele está zerado. E no meu caso os points não seriam dessa forma. Eles são uma moeda no jogo que pode ser comercializada. E o player só pegaria essas moedas quando fosse no bau entende? dessa forma é pelo báu, você provavelmente configurou errado, ou esqueceu algo, pq aqui funciona perfeitamente! Have no idea! freelance? go to my discord: sun#8860
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.