Ola Eks , Estava Admistrando meu Otserv , quando Tive uma Fantastica Ideia , Porque nao Ter uma Talkaction que Adicione Reset? que nem add skill , level club? entaum tentei criar nao , consigui, pedi ajuda ao vodkart meu Professor e Ele Foi me Ajudando e Saiu Nisso!!
EXplicando a Talkaction Funcionara assim!!!
/addreset DevilMoon,1 , Eu Estava com 10 Resets , Fiquei passar com 11!!
Entao Fizemos , 2 Scripts , um para quem Tem sistema de Reset com Talkaction
Ex: !reset
e Um para quem Tem Npc!! , Porque muinta gente Tem Duvidas em Trocar o Storage!!
Começando com o do Npc!!
Vá em Data>Talkactions>Scripts Crie uma pasta.lua chamada addreset e coloque isso!!
-- [[ Script by Devilmoon e Vodkart for XTibia.com ]] -- function onSay(cid, words, param) local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local s = 36874 local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) local storageplayer = getPlayerStorageValue(player, s) local time = storageplayer+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added "..quanty.." reset your character.") setPlayerStorageValue(player, s, time) return TRUE end
Agora em Data>Talkactions.xml Adicione a Seguinte Tag!!
<talkaction words="/addreset" event="script" value="addreset.lua"/> <talkaction words="!getresets" value="getresets.lua"/>
Agora para quem tem Sistema de Reset como Talkaction que é !reset Vamos la!!
Data>Talkactions>Scripts crie uma pasta.xml e coloque isso!!
-- [[ Script by Devilmoon e Vodkart for XTibia.com ]] -- function onSay(cid, words, param) local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local s = 1020 local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) local storageplayer = getPlayerStorageValue(player, s) local time = storageplayer+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added "..quanty.." reset your character.") setPlayerStorageValue(player, s, time) return TRUE end
Agora em Data>Talkactions.xml Adicione a Tag!
<talkaction words="/addreset" event="script" value="addreset.lua"/> <talkaction words="!getresets" value="getresets.lua"/>
Aos que Tem Reset em Npc!! Data>Talkactions>Scripts crie uma pasta.lua e renomeie para getresets e coloque isso!
function onSay(cid, words, param) function getResets(cid) resets = getPlayerStorageValue(cid,36874) if resets < 0 then resets = 0 end return resets end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (getResets(cid)) .." reset's No seu Char!") return TRUE end
Agora para os que tem reset de talkaction !reset vá em Data>Talkactions>Scripts crie uma pasta.lua chamada getresets e coloque isso!
function onSay(cid, words, param) function getResets(cid) resets = getPlayerStorageValue(cid,1020) if resets < 0 then resets = 0 end return resets end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (getResets(cid)) .." reset's No seu Char!") return TRUE end
Fim!
Agora Voce deve Estar se Perguntando , Aff vo te que adiciona o access="5" na tag , pq se nao os player vao usar!! e oque Significa aquele getresets?
Nada disso o Script ja vem com o comando!
if getPlayerAccess(cid) == 5 then
e o getsreset, mostra quantos reset seu char tem!!
Espero que Gostem do Script , e Usem Com Carinho!!!
Abraços