Ir para conteúdo
Banner com Efeitos

RenanzinADMOT

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Curtir
    RenanzinADMOT recebeu reputação de Under em Gesior sem sample nos players como adicionar?   
    No config.php ta tudo certo, porem na tabela players ta sem os sample, como adiciono?


  2. Gostei
    TESTADO EM TFS 0.4 E 0.6, PEÇO PARA QUE TESTEM EM OUTRAS VERSÕES, POR FAVOR.
     
    Prévia;

     
    Crie um arquivo KillsandDeath.lua
    function onLook(cid, thing, position, lookDistance) function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then  repeat d = d+1 until not query:next() query:free() end return d  end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times") end return true end No creaturescript.xml, coloque:
    <event type="look" name="showKD" event="script" value="KillsandDeath.lua"/> Em creaturescript/script/login.lua, coloque:
    registerCreatureEvent(cid, "showKD") Script disponibilizado por Critico.
    Tópico organizado por mim.
     
    Abraços!
     
  3. Gostei
    RenanzinADMOT deu reputação a Lyu em Ticket Medals   
    Olá pessoal, como eu não tinha nada pra fazer resolvi criar este sistema que será bem útil para usar como premiações.

    Como funciona? - Simplesmente você clica em um item chamado ticket medal e em seguida você receberá uma quantia em medalhas mas esta quantia será aleatória.

    Tabela de porcentagem abaixo :
    49% == chances de cair nada. 20% == chances de cair 3 medalhas. 15% == chances de cair 5 medalhas. 10% == chances de cair 7 medalhas. 5% == chances de cair 10 medalhas. 1% == chances de cair 25 medalhas. vamos instalar o sistema [..]
    1º - execute este código em sua database :
    ALTER TABLE `players` ADD medals INT(11) NOT NULL DEFAULT 0; 2º - crie um arquivo lua chamado 016-ticket na pasta data/lib e insira o seguinte código :
    --[[ functions by Ladyazaleia with love. ]]-- function getPlayerMedals(cid) -- function get medals. local qr = db.getResult("SELECT `medals` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";") medals = qr:getDataInt("medals", getPlayerGUID(cid)) if medals < 0 then medals = 0 end return medals end function doPlayerRemoveMedals(cid, count) -- function remove medals. if getPlayerMedals(cid) < count then return false else return db.query("UPDATE `players` SET `medals` = "..getPlayerMedals(cid)-count.." WHERE `players`.`id`= "..getPlayerGUID(cid)..";") end return true end function getTableWild() -- function get percent in randomtable. tablewild = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -- 49 % 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -- 20 % 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, -- 15 % 7,7,7,7,7,7,7,7,7,7, -- 10 % 10,10,10,10,10, -- 5 % 25, -- 1 % } return tablewild end 3º - abra o seu items.xml e adicione esta tag la no final :
     <item id="12427" article="a" name="ticket medal" plural="ticket medals">         <attribute key="weight" value="10" />         <attribute key="description" value="ticket medal is an item that when used will become worthless random medals that can be used to purchase items." />     </item> 4º - abra o seu actions.xml e insira esta tag :
    <action itemid="12427" event="script" value="ticket.lua"/> 5º - crie um arquivo lua chamado ticket na pasta data/actions/scripts e insira o seguinte código :
    --[[ script by Ladyazaleia with love. ]]-- function onUse(cid, item, fromPosition, itemEx, toPosition) rand = math.random(1, #getTableWild()) query = 'UPDATE `players` SET `medals` = '..getPlayerMedals(cid)+getTableWild()[rand]..' WHERE `players`.`id`= '..getPlayerGUID(cid)..';' if doPlayerRemoveItem(cid, 12427, 1) then db.query(query) doSendMagicEffect(getThingPos(cid), 13) doPlayerPopupFYI(cid, 'You received : ['..getTableWild()[rand]..'] medal coins.\n\nTo learn more about the system, type /medals.') end return true end 6º - abra o seu talkactions.xml e adicione esta tag la no final :
    <talkaction words="!medals;/medals" event="script" value="ticket.lua"/> 7º - crie um arquivo lua chamado ticket na pasta data/talkactions/scripts e insira o seguinte código :
    --[[ script by Ladyazaleia with love. ]]-- function onSay(cid) doPlayerPopupFYI(cid, 'Ticket medal is an item that promises to present you with medals\nfor you to purchase items available in the store medals.\n\nYou have ['..getPlayerMedals(cid)..'] medals coins.') return true end Observações :
     
    Caso você queira mudar as porcentagens, checar o arquivo 016-ticket.lua na pasta data/lib e fazer as alterações na tabela, só faça se souber.  
    Se o item 12427 já estiver registrado, mude-o! mas se não estiver registrado meu conselho é : "deixe tudo do jeito que está".  
    Você poderá usar as funções : getPlayerMedals(cid) para pegar o valor de medalhas do player & doPlayerRemoveMedals(cid, count) para remover uma quantidade de medalhas do player, count é a quantidade.  
    Desculpe pela tabela constrangedora, só consegui porcentar assim. exemplo de uso :
    function onSay(cid, words, param) local count = 10 if doPlayerRemoveMedals(cid, count) then doPlayerAddItem(cid, 2160, 100) doSendMagicEffect(getThingPos(cid), 12) else doPlayerPopupFYI(cid, 'Você não possui '..count..' medal coins.') end return true end este exemplo faz com que o player possa comprar 100 crystal coins se ele tiver 10 medal coins.
    até mais pessoal, um grande abraço e se gostou, rep+

    créditos : Halls Santos or Ladyazaleia.

     
  4. Gostei
    RenanzinADMOT deu reputação a Lyu em Equipe para Ot profissional.   
    Desde o começo de 2013 venho mechendo com otserver, nunca cheguei a terminar um pois vi que eu poderia melhorar bastante e até hoje eu fuço por ai aprendendo bastante mas o meu foco mesmo é scripting, estou estudando bastante lua e evoluindo rapidamente, bom eu acho! Caso você queira alguma ajuda pode contactar comigo, nunca formei equipe nenhuma mas eu gosto de ajudar.. Facebook : fb.com/wustehs

Informação Importante

Confirmação de Termo