Postado Junho 20, 2014 11 anos Estou com esse system de leilão, Mais eu queria que quando estivesse tendo Leilão não fosse gps que ia ser cobrado e sim um item mais que o player dissese a quantidade... o item é 2160 function onSay(cid, words, param) config = { acess = 4, time = 5, storage = {25601,25602,650213} } function getWinnerLeilao() local w = tostring(getGlobalStorageValue(config.storage[1])):gsub(':', ''):explode(',') if not getPlayerByNameWildcard(w[4]) then local item = doCreateItemEx(w[1]-1, w[2]) local x = doItemSetAttribute(item, "description", "Item comprado em leilão por "..w[3].." TDs.") doPlayerSendMailByName(w[4], item) else local x = doPlayerAddItem(getPlayerByNameWildcard(w[4]), w[1], w[2]) doItemSetAttribute(x, "description", "Item comprado em leilão por "..w[3].." TDs.") end doBroadcastMessage("O item ["..getItemNameById(w[1]).." : "..w[2].."] Foi vendido para o jogador "..w[4].." por "..w[3].." TDs!") setGlobalStorageValue(config.storage[1],-1) setGlobalStorageValue(config.storage[2],-1) for _, pid in pairs(getPlayersOnline()) do setPlayerStorageValue(pid, config.storage[3], -1) end return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = "..config.storage[3]) end if words == "/leilao" then if getPlayerAccess(cid) < config.acess then doPlayerSendTextMessage(cid, 28, "Você não pode executar essa ação.") return true end local t = string.explode(param, ",") if not tonumber(getGlobalStorageValue(config.storage[1])) then doPlayerSendTextMessage(cid, 27, "Já há um leilão ativo no momento.") return true elseif not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then doPlayerSendTextMessage(cid, 28, "Faltou parametro.")return true elseif not isItemMovable(t[1]) then doPlayerSendTextMessage(cid, 28, "Você não pode adicionar esse item no leilão.")return true end setGlobalStorageValue(config.storage[1], ":"..t[1]..",:"..(isItemStackable(t[1]) and t[2] or 1)..",:"..t[3]..",:"..getCreatureName(cid)) setGlobalStorageValue(config.storage[2], os.time()+ config.time*60) doBroadcastMessage("[Leilão] O item ["..getItemNameById(t[1]).." : "..(isItemStackable(t[1]) and t[2] or 1).."] Está em leilão até "..os.date("%X ", getGlobalStorageValue(config.storage[2])).."\nLance Minimo: "..t[3].." TDs.") addEvent(getWinnerLeilao, config.time*1000*60) elseif words == "!lance" then if tonumber(getGlobalStorageValue(config.storage[1])) then doPlayerSendTextMessage(cid, 27, "Não tem nenhum leilão ativo no momento.") return true end local s = tostring(getGlobalStorageValue(config.storage[1])):gsub(':', ''):explode(',') if param == "lista" then doShowTextDialog(cid,s[1], "Item: "..getItemNameById(s[1]).."\n\nQuantidade: "..s[2].."\n\nMaior lance atual: "..s[3].."\n\nJogador: "..s[4].."\n\nPrazo Final: "..os.date("%X ", getGlobalStorageValue(config.storage[2]))) return true elseif not tonumber(param) or tonumber(param) <= 0 or tonumber(param) > 9999999 then doPlayerSendTextMessage(cid, 28, "digite um número válido.") return true end local li = getPlayerStorageValue(cid, config.storage[3]) < 0 and 0 or getPlayerStorageValue(cid, config.storage[3]) local conta = (li + tonumber(param)) if conta <= tonumber(s[3]) then doPlayerSendTextMessage(cid, 28, "você tem que dar um lance maior que "..s[3].." TDs") return true elseif not doPlayerRemoveMoney(cid, tonumber(param)) then doPlayerSendTextMessage(cid, 28, "você não tem TDs suficientes para dar um lance") return true end setPlayerStorageValue(cid, config.storage[3], conta) setGlobalStorageValue(config.storage[1], ":"..s[1]..",:"..s[2]..",:"..conta..",:"..getCreatureName(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns, agora você deu o maior lance de "..conta.." TDs no item [Nome: "..getItemNameById(s[1]).."] [Count: "..s[2].."]") end return true end http://www.weblara.com.br/
Postado Junho 20, 2014 11 anos Tenta ae : function onSay(cid, words, param) config = { acess = 4, time = 5, storage = {25601,25602,650213} } function getWinnerLeilao() local w = tostring(getGlobalStorageValue(config.storage[1])):gsub(':', ''):explode(',') if not getPlayerByNameWildcard(w[4]) then local item = doCreateItemEx(w[1]-1, w[2]) local x = doItemSetAttribute(item, "description", "Item comprado em leilão por "..w[3].." TDs.") doPlayerSendMailByName(w[4], item) else local x = doPlayerAddItem(getPlayerByNameWildcard(w[4]), w[1], w[2]) doItemSetAttribute(x, "description", "Item comprado em leilão por "..w[3].." TDs.") end doBroadcastMessage("O item ["..getItemNameById(w[1]).." : "..w[2].."] Foi vendido para o jogador "..w[4].." por "..w[3].." TDs!") setGlobalStorageValue(config.storage[1],-1) setGlobalStorageValue(config.storage[2],-1) for _, pid in pairs(getPlayersOnline()) do setPlayerStorageValue(pid, config.storage[3], -1) end return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = "..config.storage[3]) end if words == "/leilao" then if getPlayerAccess(cid) < config.acess then doPlayerSendTextMessage(cid, 28, "Você não pode executar essa ação.") return true end local t = string.explode(param, ",") if not tonumber(getGlobalStorageValue(config.storage[1])) then doPlayerSendTextMessage(cid, 27, "Já há um leilão ativo no momento.") return true elseif not tonumber(t[1]) or not tonumber(t[2]) or not tonumber(t[3]) then doPlayerSendTextMessage(cid, 28, "Faltou parametro.")return true elseif not isItemMovable(t[1]) then doPlayerSendTextMessage(cid, 28, "Você não pode adicionar esse item no leilão.")return true end setGlobalStorageValue(config.storage[1], ":"..t[1]..",:"..(isItemStackable(t[1]) and t[2] or 1)..",:"..t[3]..",:"..getCreatureName(cid)) setGlobalStorageValue(config.storage[2], os.time()+ config.time*60) doBroadcastMessage("[Leilão] O item ["..getItemNameById(t[1]).." : "..(isItemStackable(t[1]) and t[2] or 1).."] Está em leilão até "..os.date("%X ", getGlobalStorageValue(config.storage[2])).."\nLance Minimo: "..t[3].." TDs.") addEvent(getWinnerLeilao, config.time*1000*60) elseif words == "!lance" then if tonumber(getGlobalStorageValue(config.storage[1])) then doPlayerSendTextMessage(cid, 27, "Não tem nenhum leilão ativo no momento.") return true end local s = tostring(getGlobalStorageValue(config.storage[1])):gsub(':', ''):explode(',') if param == "lista" then doShowTextDialog(cid,s[1], "Item: "..getItemNameById(s[1]).."\n\nQuantidade: "..s[2].."\n\nMaior lance atual: "..s[3].."\n\nJogador: "..s[4].."\n\nPrazo Final: "..os.date("%X ", getGlobalStorageValue(config.storage[2]))) return true elseif not tonumber(param) or tonumber(param) <= 0 or tonumber(param) > 9999999 then doPlayerSendTextMessage(cid, 28, "digite um número válido.") return true end local li = getPlayerStorageValue(cid, config.storage[3]) < 0 and 0 or getPlayerStorageValue(cid, config.storage[3]) local conta = (li + tonumber(param)) if conta <= tonumber(s[3]) then doPlayerSendTextMessage(cid, 28, "você tem que dar um lance maior que "..s[3].." TDs") return true elseif not doPlayerRemoveItem(cid, 2160, tonumber(param)) then doPlayerSendTextMessage(cid, 28, "você não tem TDs suficientes para dar um lance") return true end setPlayerStorageValue(cid, config.storage[3], conta) setGlobalStorageValue(config.storage[1], ":"..s[1]..",:"..s[2]..",:"..conta..",:"..getCreatureName(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns, agora você deu o maior lance de "..conta.." TDs no item [Nome: "..getItemNameById(s[1]).."] [Count: "..s[2].."]") end return true end Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
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.