Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''valentine''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 1 registro

  1. Valentine's Card System!

    Informações = { Nome = Valentine's Card System Autor = Iuri Mandello, ideia nesse tópico : http://forums.otserv.com.br/f330/cartao-de-amor-139041/ Versão testada = TFS 0.3.5 } Boa tarde,ainda não tenho quase nenhum script postado no fórum, mas prometo a partir de agora me dedicar mais ao fórum (Y) Informações Bom vamos ao que interessa, esse script da uma ultilidade a mais ao Valentine's Card, com ele você pode enviar e receber cartões de amor. Comandos /love Fulano,mensagem -- Envia um cartão para a pessoa, se ele estiver online receberá na hora senão receberá no login. /love info -- Informações sobre o script Script Crie um arquivo chamado love.lua na pasta Talkactions/scripts e coloque isso dentro: function onSay(cid,words,param,channel) if param == 'info' then return doPlayerPopupFYI(cid, 'Valentine s Card System v 1.0 by Iuri Mandello\a Comandos: /love Player,Mensagem = Envia o cartão para o player.') end local t1,t2 = param:match('(.-),%s*(.+)')-- Valeu Mock if t1 == nil then return doPlayerSendTextMessage(cid,22,"Select a player to send the message") end if (getPlayerGUIDByName(t1) == nil) then return doPlayerSendTextMessage(cid,22,"Player does not exist") end if t2 == nil then return doPlayerSendTextMessage(cid,22,"No message specified") end if string.len(tostring(t2)) > 100 then return doPlayerSendTextMessage(cid,22,"The message is long") end if string.len(tostring(t2)) < 0 then return doPlayerSendTextMessage(cid,22,"The message is short") end if isOnline(t1) then local item = doPlayerAddItem(getPlayerByName(t1),6538) doSetItemText(item, tostring(t2)) doPlayerSendTextMessage(cid,22,"Card send successfully") return TRUE end if io.open("data//love//".. tostring(t1) ..".txt") == nil then local file = io.open("data//love//".. tostring(t1) ..".txt","w") file:write("by ".. getPlayerName(cid) ..":".. tostring(t2) .."\n") file:close() doPlayerSendTextMessage(cid,22,"Card send successfully") else local file = io.open("data//love//".. tostring(t1) ..".txt","a+") file:write("by ".. getPlayerName(cid) ..":".. tostring(t2)) file:close() doPlayerSendTextMessage(cid,22,"Card send successfully") end return TRUE end Tag xml para ser colocada em talkactions.xml: <talkaction words="/love" event="script" value="love.lua"/> Crie um arquivo chamado lovelogin.lua na pasta creaturescripts/scripts e coloque isso dentro: function onLogin(cid) local file = io.open("data//love//".. getCreatureName(cid) ..".txt") if file ~= nil then doPlayerSendTextMessage(cid,22,"You received one love card!") for msg in io.lines("data//love//".. getCreatureName(cid) ..".txt") do item = doPlayerAddItem(cid,6538) doSetItemText(item,msg) end file:close() os.remove("data//love//".. getCreatureName(cid) ..".txt") end return TRUE end Tag para ser colocada em creaturescripts.xml: <event type="login" name="Love" script="lovelogin.lua"/> Agora abra o arquivo creaturescripts/scripts/login.lua e adicione entes do último return TRUE: registerCreatureEvent(cid, "Love") <font face="Comic Sans MS"><font size="4"><font size="2"><font size="4"><font size="2"><font size="4"><font size="2"> Você precisará da OTAL ou simplesmente coloque isso em lib/functions.lua ou arquivo semelhante: function isOnline(name)--by mock local players = getOnlinePlayers() name = string.lower(name) for i, player in ipairs(players) do player = string.lower(player) if name == player then return TRUE end end return FALSE end Por último, crie uma pasta chamada love na pasta data do seu servidor e está pronto Espero que tenham gostado, e por favor não faça comentários como "Legal","Vou usar no meu server", se quiser agradecer use o botão Thanks,use o tópico somente para dúvidas e bugs. Esse script é exclusivo da OTnet, se encontrar em outro fórum por favor avise
×