Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Amigo, esse conteúdo já existe no fórum ... eu dei uma analisada e me parece idêntico, por favor poste aqui se houver diferença, caso não tenha terei que fechar =/

• http://www.tibiaking.com/forum/topic/7571-offline-player-to-player-item-trader-auction-system/

Abraços e aguardo resposta!

Link para o post
Compartilhar em outros sites

Eu procurei e não encontrei, caso tenha, sem problemas, pode deletar Luan, e valeu pela forma de se expressar!

Pode ser que haja diferença se o outro tiver funcionando não tem diferença, mais se não tiver funcionando tem a diferença, por exemplo onde peguei tutorial feito pelo próprio criador do sistema esse script não funcionou, foi feito um ajuste e agora está funcionando!

Editado por Natanael Beckman (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 1 month later...

Foi Testado em 8.54?

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Link para o post
Compartilhar em outros sites
  • 3 weeks later...

 

Segue um lista in-game para quem não usa gesior e queria o sistema ! 

7v6wdVV.png

 

 

 

esse tela de windows n esta abrindo,  saberia colocar para aparece no channel do default n ?

aki erro mysql_real_query(): SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC - MYSQL ERROR: Table 'ps.auction_system' doesn't exist (1146)

Editado por Sr Omar (veja o histórico de edições)

Link para o post
Compartilhar em outros sites
  • 1 month later...

duvida, caso eu queira vender 10 demon armors, os itens vão ficar "juntos" no site?

 

outra duvida, caso eu queria comprar os 10 demon armors, eu posso colocar assim !shop buy,id,10?

[progress=green]50[/progress]

 

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
  • 5 months later...
  • 1 month later...
  • 11 months later...

Estou com erro ao inserir item.

Alguem pode me ajudar ?

 

ScreenShot021.jpg

 

 

RESOLVIDO

 

troquei db.executeQuery por db.query

Editado por kennedyfsa
Problema Resolvido (veja o histórico de edições)
 
Link para o post
Compartilhar em outros sites
  • 3 months later...

Tentei modificar o script pra passar pra 10.95 porém não consegui, tava dando uns erros de string e tal ai modifiquei

local t = param:split(',')

Dai parou de dar erro no distro, porém quando vou adicionar não funciona e fica dando isso

 

19:21 This price or item count is too high.
19:21 Tester [20]: !offer add, crown armor, 1, 500

 

Ja tentei todos valores, se eu colocar 1 ele diz que o item não existe.

 

Se alguem puder ajudar.

 

 

Link para o post
Compartilhar em outros sites
  • 3 weeks later...
  • 1 month later...

esta dando esse erro no gesior  Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\pages\auctionsystem.php on line 2

OT PURA DIVERSÃO | IP: otfun.servegame.com | 8.60 | Port: 7171

 

1584817_1.png

Link para o post
Compartilhar em outros sites
  • 2 months later...
Em 25/05/2014 ás 20:44, Natanael Beckman disse:

Esse sistema disponibiliza uma negociação offline, onde você oferta um item e esse item é divulgado no site do server e qualquer player pode comprar o item utilizando um comando especificado.

 

Crie uma arquivo .lua dentro da pasta data/talkactions/scripts com o nome auctionsystem.lua, dentro do mesmo adicione o code:


local config = {
        levelRequiredToAdd = 20,
        maxOffersPerPlayer = 5,
        SendOffersOnlyInPZ = true,
        blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933}
        }
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
        local t = string.explode(param, ",")
        if(t[1] == "add") then
                if((not t[2]) or (not t[3]) or (not t[4])) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                        return true
                end
                if(not tonumber(t[3]) or (not tonumber(t[4]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")
                        return true
                end
                if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")
                        return true
                end
                local item = getItemIdByName(t[2])
                if(not item) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
                        return true
                end
                if(getPlayerLevel(cid) < config.levelRequiredToAdd) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")
                        return true
                end
                if(isInArray(config.blocked_items, item)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")
                        return true
                end
                if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).")
                        return true
                end
                local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")
                if(check:getID() == -1) then
                elseif(check:getRows(true) >= config.maxOffersPerPlayer) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")
                        return true
                end
                if(config.SendOffersOnlyInPZ) then    
                        if(not getTilePzInfo(getPlayerPosition(cid))) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")
                                return true
                        end
                end
                if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")
                        return true
                end
                                local itemcount, costgp = math.floor(t[4]), math.floor(t[3])
                doPlayerRemoveItem(cid, item, itemcount)
                db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")")
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.")
        end
        if(t[1] == "buy") then
                if(not tonumber(t[2])) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                        return true
                end
                local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")
                if(buy:getID() ~= -1) then
                        if(getPlayerMoney(cid) < buy:getDataInt("cost")) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")
                                buy:free()
                                return true
                        end
                        if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.")
                                buy:free()
                                return true
                        end
                        if(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")))then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.")
                                buy:free()
                                return true
                        end
                        if(isItemStackable((buy:getDataString("item_id")))) then
                                doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count"))
                        else
                                for i = 1, buy:getDataInt("count") do
                                        doPlayerAddItem(cid, buy:getDataString("item_id"), 1)
                                end
                        end
                        doPlayerRemoveMoney(cid, buy:getDataInt("cost"))
                        db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!")
                        db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";")
                        buy:free()
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                end
        end
        if(t[1] == "remove") then
                if((not tonumber(t[2]))) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                        return true
                end
                                if(config.SendOffersOnlyInPZ) then    
                                        if(not getTilePzInfo(getPlayerPosition(cid))) then
                                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")
                                                return true
                                        end
                end
                local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")        
                if(delete:getID() ~= -1) then
                        if(getPlayerGUID(cid) == delete:getDataInt("player")) then
                                db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                                if(isItemStackable(delete:getDataString("item_id"))) then
                                        doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count"))
                                else
                                        for i = 1, delete:getDataInt("count") do
                                                doPlayerAddItem(cid, delete:getDataString("item_id"), 1)
                                        end
                                end
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.")
                        else
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")
                        end
                delete:free()
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                end
        end
        if(t[1] == "withdraw") then
                local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                if(balance:getDataInt("auction_balance") < 1) then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")
                        balance:free()
                        return true
                end
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!")
                doPlayerAddMoney(cid, balance:getDataInt("auction_balance"))
                db.executeQuery("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                balance:free()
        end
        return true
end

Em seguida em talkactions.xml adicione a tag:


<talkaction words="!offer" event="script" value="auctionsystem.lua"/>

No banco de dados execute as querys:


CREATE TABLE `auction_system` (
  `id` int(11) NOT NULL auto_increment,
  `player` int(11),
  `item_id` int(11),
  `item_name` varchar(255),
  `count` int(11),
  `cost` int(11),
  `date` int(11),
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

ALTER TABLE `players` ADD `auction_balance` INT( 11 ) NOT NULL DEFAULT '0';

Na pasta do seu site crie um arquivo chamado tradeoff.php, em seguida adicione o code:


<?PHP
$auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll();
$players = 0;
       
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instruction<b></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><center><h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br /><small>example: !offer add, plate armor, 500, 1</small><br /><br /><B>!offer buy, AuctionID</b><br /><small>example: !offer buy, 1943</small><br /><br /><b>!offer remove, AuctionID</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Use this command to get money for sold items.</small></center></TR></TD></TABLE><br />';
    if(empty($auctions))
    {
        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';
        $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';
    }
    else
    {
    foreach($auctions as $auction) {
        $players++;
            if(is_int($players / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];
        $cost = round($auction['cost']/1000, 2);
        $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auction['id'].'</center></TD><TD><center><img src="/item_images/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></center></TD><TD><center>!offer buy, '.$auction['id'].'</center></TR>';
    }
    
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>#</center></b></TD><TD class="white"><b><center>Item Name</center></b></TD><TD class="white"><b><center>Player</center></b></TD><TD class="white"><b><center>Count</center></b></TD><TD class="white"><b><center>Cost</center></b></td><TD class="white"><b><center>Buy</center></b></td></TR>'.$content.'</TABLE>';
    $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vdk.1553/">vDk</a>.</small></p>';
}
    ?> 

Em layouts.php adcione o code:


                                <a href="?subtopic=tradeoff">
                                        <div id="submenu_tradeoff" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">
                                                <div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>
                                                <div id="ActiveSubmenuItemIcon_tradeoff" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>
                                                <div id="ActiveSubmenuItemLabel_tradeoff" class="SubmenuitemLabel">Trade Off</div>
                                                <div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>
                                        </div>
                                </a>

Pra finalizar em index.php adicione esse code:


case "tradeoff";
   $topic = "Trade Off";
   $subtopic = "tradeoff";
   include("tradeoff.php");
break;

m1m4mJw.png

-

E pronto galera clica em GOSTEI e comenta no tópico.

 

 

 

eu uso otpanel.. e nao consigo adicionar

> case "tradeoff";
   $topic = "Trade Off";
   $subtopic = "tradeoff";
   include("tradeoff.php");
break; <

no index.php pois o arquivo foi criado dentro da pasta (pages)

e o index dele é redirecionado. como faço para a case puchar da pasta pages..

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • 1 month later...

@Natanael Beckman @Antipush @dougbart @KotZletY

Pessoal, alguém pode tirar minha dúvida?

Implantei esse sistema no meu server, o comando está funcionando normalmente (ele até retira o item do char quando eu aciono o comando)

porém no site os itens não aparecem.

fica assim: "Currently is no one active Auction."

 

Alguém já teve esse problema e pode me ajudar?

Obrigado!

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por looktsx
      Salve Rapaziada tudo bom .
      queria ajuda pra cria um teleport ou uma alavanca com tempo ..
      depois do player usa o teleport ou a lavanca ele so poderá usa depois de tal determinado tempo.
       
      SERVIDOR 12.91
      Se alguem poder me ajuda vou fica grato ,
      des de ja agradeço a todos.
      ..
    • Por willian646
      O evento é totalmente baseado no Foxy Quiz proveniente do GLA, no entanto é apenas uma base para vocês alterarem como acharem melhor.
      Para começar será necessario que você crie um arquivo em talkactions>scripts para entrar no evento, como por exemplo : participar.lua
      e entao colocar sua tag em talkactions.xml, como por exemplo: 
      <talkaction words="!participar;/participar" script="!participar.lua"/> Tendo feito isso você irá colar esse codigo dentro desse arquivo: 
      function onSay(cid, words, param)pos = {x=1236, y=1125, z=15} --POSIÇAO QUE O PLAYER IRÁ COM O COMANDO if getGlobalStorageValue(88788) == 1 then doSendMagicEffect(getPlayerPosition(cid),19) doTeleportThing(cid,pos) else doPlayerSendCancel(cid, "Desculpe mas o evento esta fechado !") end return true end Agora iremos para o script principal, vá em global events>scripts e crie o arquivo pokequiz.lua em seguida coloque sua tag em globalevents.xml como por exemplo: 
      <globalevent name="Pokequiz" interval="10" event="script" value="pokequiz.lua"/> Lembrando que o intervalo de inicio do evento é com vcs, Tendo feito isso abra o arquivo e cole o  seguinte código dentro : 
      quizstrg = 88788 local wave = 0 local CPpos = {x=1051, y=1047, z=7} --POSIÇAO QUE O PLAYER IRÁ SE ERRAR function wave_acresc() wave = wave + 1 addEvent(Quiz, 5000) end function Quiz() if wave == 1 then doBroadcastMessage("Na serie pokemon RAYQUAZA possui mega evolucao ?", RED) addEvent(Resposta, 10000) elseif wave == 2 then doBroadcastMessage("Na serie pokemon ARCEUS e considerado um pokemon RARO ?", RED) addEvent(Resposta, 10000) elseif wave == 3 then doBroadcastMessage("Na serie pokemon MEW criou os 3 caes lendarios ?", RED) addEvent(Resposta, 10000) elseif wave == 4 then doBroadcastMessage("Na serie pokemon ARCEUS tem o poder de mudar de tipo livremente ?", RED) addEvent(Resposta, 10000) elseif wave == 5 then doBroadcastMessage("Na serie pokemon GIRATINA possui 2 formas sendo elas alterada e fantasma ?", RED) addEvent(Resposta, 10000) elseif wave == 6 then doBroadcastMessage("Na serie pokemon DIALGA e PALKIA sao rivais ?", RED) addEvent(Resposta, 10000) elseif wave == 7 then doBroadcastMessage("Na serie pokemon CELEBI possui a habilidade de viajar entre dimensoes ?", RED) addEvent(Resposta, 10000) elseif wave == 8 then doBroadcastMessage("Na serie pokemon SOLGALEO e a primeira evolucao de cosmog ?", RED) addEvent(Resposta, 10000) elseif wave == 9 then doBroadcastMessage("Na serie pokemon MAGEARNA e uma das ultra beasts ?", RED) addEvent(Resposta, 10000) elseif wave == 10 then doBroadcastMessage("Na serie pokemon a cor original de MAGEARNA e laranja ?", RED) addEvent(Resposta, 10000) elseif wave == 11 then doBroadcastMessage("O evento Quiz terminou !", RED) addEvent(winPlayers, 5000) end end function Resposta() if wave == 1 then addEvent(TPFalso, 5000) elseif wave == 2 then addEvent(TPVerdadeiro, 5000) elseif wave == 3 then addEvent(TPVerdadeiro, 5000) elseif wave == 4 then addEvent(TPFalso, 5000) elseif wave == 5 then addEvent(TPVerdadeiro, 5000) elseif wave == 6 then addEvent(TPFalso, 5000) elseif wave == 7 then addEvent(TPVerdadeiro, 5000) elseif wave == 8 then addEvent(TPVerdadeiro, 5000) elseif wave == 9 then addEvent(TPVerdadeiro, 5000) elseif wave == 10 then addEvent(TPFalso, 5000) end end function TPFalso() for _, sid in ipairs(getPlayersOnline()) do local posi = {x=1236, y=1122, z=15} local posf = {x=1243, y=1128, z=15} local pos = getPlayerPosition(sid) if isInArea(pos, posi, posf) then doTeleportThing(sid,CPpos) end addEvent(wave_acresc, 5000) end end function TPVerdadeiro() for _, sid in ipairs(getPlayersOnline()) do local posi = {x=1228, y=1122, z=15} local posf = {x=1235, y=1128, z=15} local pos = getPlayerPosition(sid) if isInArea(pos, posi, posf) then doTeleportThing(sid,CPpos) end addEvent(wave_acresc, 5000) end end function winPlayers() for _, sid in ipairs(getPlayersOnline()) do local posi = {x=1228, y=1122, z=15} local posf = {x=1243, y=1128, z=15} local pos = getPlayerPosition(sid) if isInArea(pos, posi, posf) then doTeleportThing(sid,CPpos) doPlayerAddItem(sid,2159, 10) end wave = 0 setGlobalStorageValue(88788, 0) end end --AVISOS DE INICIO function finalEventWarning() if getGlobalStorageValue(quizstrg) == 1 then setGlobalStorageValue(88788, 2) doBroadcastMessage("O evento Quiz fechou, a primeira pergunta surgira em 30 segundos.", RED) addEvent(wave_acresc, 30000) end end function secondEventWarning() if getGlobalStorageValue(quizstrg) == 1 then doBroadcastMessage("O evento Quiz ira iniciar em 1 minuto, usem o comando !participar ou /participar.", RED) addEvent(finalEventWarning, 60000) end end function firstEventWarning() if getGlobalStorageValue(quizstrg) == 1 then doBroadcastMessage("O evento Quiz ira iniciar em 3 minutos, usem o comando !participar ou /participar.", RED) addEvent(secondEventWarning, 120000) end end function onThink(interval, lastExecution) if getGlobalStorageValue(quizstrg) == 0 then setGlobalStorageValue(88788, 1) doBroadcastMessage("O evento Quiz ira iniciar em 5 minutos, usem o comando !participar ou /participar.", RED) addEvent(firstEventWarning, 120000) end return true end Já ia me esquecendo, a unica coisa ao qual vocês devem mudar de acordo com as coordenadas do seu mapa e área do evento são as funções TPVerdadeiro , TPFalso, winPlayers , elas servem para indicar qual área é a errada e teleportar quem tiver nessa área pro cp, caso o lado errado seja o esquerdo então será usado a função  TPVerdadeiro, e é a msm coisa para o outro lado, no caso da winPlayers é toda a área do evento.
       
      Aqui vai um exemplo: 
       
      E é isso rapaziada, não sei se já possui algum evento parecido por essas bandas, mas eu não encontrei ,então fiz  e resolvi contribuir com a comunidade, peço que se for repostar em algum outro lugar dê os devidos créditos, obg e até a próxima.
    • Por Ghaz
      Fala pessoal tudo bem?
       
      Estou com dificuldades em um script e preciso da ajuda dos magos do LUA rs.
       
      Tenho um script que quando o player morre (onDeath), ele faz algumas coisas e depois ele chama uma função que deveria retornar uma table (array) para eu fazer o for com o ipairs certinho. Segue abaixo o código:
       
       
      Segue abaixo a função getPlayersInArea:
       
       
      Acontece que no código de cima (do primeiro spoiler) eu dou um print no retorno da função getPlayersInArea, porém ela não tá me retornando a table, tá me retornando só: 2
       
       
       
      Alguém consegue me ajudar em, como raios eu faço a função retornar a lista de players ao invés da quantidade? Acredito que ta retornando o count da table, e não os itens do array.
       
       
      Agradeço desde já, valeu tchurma!
    • Por sannn
      --[[ /////////////////////////////////////////////////////////////////////////////////////////////////////// Discord: San#7791 -- Loja System 2.0 -- TFS 0.3.6 -- para adicionar qualquer item na loja: basta adicionar na tabelinha, seguindo o exemplo do vip! valor = quantidade de DIAMOND a ser cobrada; itemID = item a ser recebido; quantidade = quantidade de itens a ser recebidos; msg = mensagem que o player vai receber após comprar! Feito por San Discord: San#7791 exemplo de como comprar: !loja vip podendo ser adicionado a modules também. tag talkactions.xml // <talkaction words="!loja" case-sensitive="no" event="script" value="Loja System 2.0.lua"/> ////////////////////////////////////////////////////////////////////////////////////////////////////// depois de tantos sistemas com mil elseifs, vim trazer esta contribuição simples, para facilitar a vida de muitos adms! Contribuição pra comunidade =D ]]-- LOJA_CANCEL = "Você não possui diamantes o suficiente." LOJA_INVALID = "Não temos este item a venda na loja!" INVALID = "Comando incorreto" DIAMOND = 2145 -- item que será cobrado; tabelinha = { ["vip"] = {valor = 5, itemID = 2160, quantidade = 1, msg = "Obrigado por comprar um VIP em nossa loja!"}, -- coloque sempre minusculo o nome ! ["vip"]... etc } function onSay(cid, words, param, channel) local msg = string.lower(param) -- Não mexa! if msg == "" then doPlayerSendTextMessage(cid, 22, INVALID) return true end -- verificação if tabelinha[msg] == nil then doPlayerSendTextMessage(cid, 22, INVALID) return true end -- verificação if tabelinha[msg].valor then if getPlayerItemCount(cid, DIAMOND) >= tabelinha[msg].valor then doPlayerRemoveItem(cid, DIAMOND, tabelinha[msg].valor) doPlayerAddItem(cid, tabelinha[msg].itemID, tabelinha[msg].quantidade) doPlayerSendTextMessage(cid, 20, tabelinha[msg].msg) else doPlayerSendTextMessage(cid, 22, LOJA_CANCEL) return true end else doPlayerSendTextMessage(cid, 22, LOJA_INVALID) end return true end  
    • Por Guilherme.
      Bom galera, certa vez eu abri um servidor de tibia 8.55, ai pra incrementar ele resolvi colocar um sistema que faz com que o player compre os Itens VIPs direto do jogo.
       
       
      Funciona assim: Eu disponibilizei no site, a venda de moedas que podem ser usadas para comprar tanto VIP Account, quanto Itens VIP direto do jogo. O jogador que compra as moedas, recebe 100 delas e para poder comprar os itens eu editei uma TalkAction que veio no Baiak Yourots que era uma simples quest por comando, e transformei em uma ótima ferramenta para servidores com sistema vip.
      Vamos ao Script:
      Vá em data\talkactions\scripts , e crie um arquivo com o nome desejado e com o final ".lua" (Exemplo: ex.lua)
      Coloque isso dentro:
      Edite conforme você quiser, salve e feche.
      Laranja: ID do iten que vai servir como "moeda"
      Verde: Quantidade do iten
      Vermelho: ID do iten que o player vai receber quando usar o comando
      Azul: Quantidade do iten recebido
      Roxo: Palavra que aparecerá quando o player digitar o comando
      Rosa: Mensagem enviada ao player caso ele não tenha o iten ou quantidade neessária para a compra.
      Agora vá em "data\talkactions\" , edite o talkactions.xml
      Coloque isso la dentro:
      Verde: O Que o Player irá falar para usar o comando. ( Exemplo: !armor )
      Azul: O Nome do Arquivo que você criou em "data\talkactions\scripts". ( Exemplo: ex.lua )
      Créditos:
      Script: Baiak Lula ( Peguei o script do OT dele então, não tenho Certeza )
      Edição e Nova Função: Guilherme.
      COMENTEM !
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo