Ir para conteúdo

Featured Replies

  • Respostas 10
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • eai cara, eu gostaria de um feedback... deu certo no seu servidor? gostou do sistema? eu levei um tempo pra fazer ele e gostaria de saber se te agradou

  • mods\scripts\expstagescroll.lua: local config = {      storage = 99000,     expstorage = 99001,     register = 99002, savexp = 99003     }  function onSay(cid, words, param) if getPlayerAccess(

Postado

tava viajando e voltei hj.. amanhã provavelmente eu retome as atividades aqui  no fórum e te aviso dos meus progressos mas acho que é só fazer onThink mesmo e a talkaction ativa o creaturescript.. daí no login eu faço um sisteminha de checagem pra caso o player deslogar. Tá praticamente pronto, só falta colocar no notepad e testar kkk

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
  • Solução

mods\scripts\expstagescroll.lua:

local config = { 
    storage = 99000,
    expstorage = 99001,
    register = 99002,
savexp = 99003
    } 




function onSay(cid, words, param)
if getPlayerAccess(cid) >= 3 then
local t = string.explode(param, ",")
if not t[2] and not t[3] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end


local pid = getPlayerByName(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
return true
end


if isNumber(t[2]) and isNumber (t[3]) then
local tempo = tonumber(t[2])*60
local constant = tonumber(t[3])
local rate = constant/8


setPlayerStorageValue(pid, config.savexp, rate) 




 if getPlayerStorageValue(pid, config.storage) <= 0 then
   local rates = getPlayerRates(pid)
   setPlayerStorageValue(pid, config.expstorage, rates[SKILL__LEVEL])
   setPlayerStorageValue(pid, config.register, 1)
   doCreatureSay(pid, "Your experience rate has been changed! It now is: " .. rate .. "x ("..constant.."/8) of your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
   setPlayerStorageValue(pid, config.storage, os.time()+tempo) 
   doPlayerSetExperienceRate(pid, rates[SKILL__LEVEL]*rate) 
   registerCreatureEvent(pid, "ExpStage")
    else
   doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid)
    end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Param must be a number.")
end
end
return true
end


function onThink(cid, interval)
    if getPlayerStorageValue(cid, config.register) == 1 then
   if getPlayerStorageValue(cid, config.storage) <= os.time() then
   doCreatureSay(cid, "Your experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid)
   setPlayerStorageValue(cid, config.storage, 0)
   setPlayerStorageValue(cid, config.register, 0)
   local oldexp = getPlayerStorageValue(cid, config.expstorage)
   doPlayerSetExperienceRate(cid, oldexp)
   end
    end
return true
end


function onLogin(cid)
    if getPlayerStorageValue(cid, config.register) == 1 then
   registerCreatureEvent(cid, "ExpStage")
   local rates = getPlayerRates(cid)
   if getPlayerStorageValue(cid, config.storage) > os.time() then
doCreatureSay(cid, "Your experience rate is still here!.", TALKTYPE_ORANGE_1, true, cid)
   local oldexp = getPlayerStorageValue(cid, config.expstorage)
local newrate = getPlayerStorageValue(cid, config.savexp)
   doPlayerSetExperienceRate(cid, oldexp*newrate)
   end
    end 
return true
end 

mods\expscroll.xml:

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes">
    <talkaction log="yes" words="/expreduce" event="script" value="expstagescroll.lua"/>
    <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/>
    <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/>
</mod>

funcionou 200% no meu TFS 0.3.6.. além de diminuir a exp ele tb aumenta a exp se o numero for maior que 8. 
Pra testar use /expreduce nome do seu char, 1 (significa 1 minuto), 4 (metade de 8)

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
  • Autor

 

mods\scripts\expstagescroll.lua:

local config = { 
    storage = 99000,
    expstorage = 99001,
    register = 99002,
savexp = 99003
    } 




function onSay(cid, words, param)
if getPlayerAccess(cid) >= 3 then
local t = string.explode(param, ",")
if not t[2] and not t[3] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end


local pid = getPlayerByName(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
return true
end


if isNumber(t[2]) and isNumber (t[3]) then
local tempo = tonumber(t[2])*60
local constant = tonumber(t[3])
local rate = constant/8


setPlayerStorageValue(pid, config.savexp, rate) 




 if getPlayerStorageValue(pid, config.storage) <= 0 then
   local rates = getPlayerRates(pid)
   setPlayerStorageValue(pid, config.expstorage, rates[SKILL__LEVEL])
   setPlayerStorageValue(pid, config.register, 1)
   doCreatureSay(pid, "Your experience rate has been changed! It now is: " .. rate .. "x ("..constant.."/8) of your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
   setPlayerStorageValue(pid, config.storage, os.time()+tempo) 
   doPlayerSetExperienceRate(pid, rates[SKILL__LEVEL]*rate) 
   registerCreatureEvent(pid, "ExpStage")
    else
   doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid)
    end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Param must be a number.")
end
end
return true
end


function onThink(cid, interval)
    if getPlayerStorageValue(cid, config.register) == 1 then
   if getPlayerStorageValue(cid, config.storage) <= os.time() then
   doCreatureSay(cid, "Your experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid)
   setPlayerStorageValue(cid, config.storage, 0)
   setPlayerStorageValue(cid, config.register, 0)
   local oldexp = getPlayerStorageValue(cid, config.expstorage)
   doPlayerSetExperienceRate(cid, oldexp)
   end
    end
return true
end


function onLogin(cid)
    if getPlayerStorageValue(cid, config.register) == 1 then
   registerCreatureEvent(cid, "ExpStage")
   local rates = getPlayerRates(cid)
   if getPlayerStorageValue(cid, config.storage) > os.time() then
doCreatureSay(cid, "Your experience rate is still here!.", TALKTYPE_ORANGE_1, true, cid)
   local oldexp = getPlayerStorageValue(cid, config.expstorage)
local newrate = getPlayerStorageValue(cid, config.savexp)
   doPlayerSetExperienceRate(cid, oldexp*newrate)
   end
    end 
return true
end 

mods\expscroll.xml:

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes">
    <talkaction log="yes" words="/expreduce" event="script" value="expstagescroll.lua"/>
    <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/>
    <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/>
</mod>

funcionou 200% no meu TFS 0.3.6.. além de diminuir a exp ele tb aumenta a exp se o numero for maior que 8. 

Pra testar use /expreduce nome do seu char, 1 (significa 1 minuto), 4 (metade de 8)

 

 

Muitíssimo obrigado! Vou testar ainda hoje!

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo