Autor : XotservX (Eu)Versão : testado em tfs 0.3.6
Oque ele faiz?
É um sistema onde é cobrado cada minuto , que fique nos trainers , para comprar é só disser !trainer (minutos)
tendo um limite , qndo o tempo acaba é teleportado automaticamente para o templo , caso queira sair dos trainers , sem esperar o tempo é só disser !trainer off , e vc vai para templo , e o tempo volta ao 0.
OBS : se nos trainers tem teleport , para ir e para voltar, tire os teleports, e deixe somente o sistema para não causa bugs.
Crie um arquivo em lua, com nome de trainer , e cole o script.
-- [Perfect Trainer System By : XotservX ] -- function onSay(cid, words, param) -- Configs -- local money = 1000 -- preço por cada minuto. local trainerpos = {x=535, y=2001, z=7} -- posição dos trainers. local maxminute = 40 -- minutos maximo. local endpos = getTownTemplePosition(getPlayerTown(cid)) -- [[posição para sair dos trainers (configurada para posição do templo)]] -- if isNumber(tonumber(param)) then param = math.ceil(tonumber(param)) if not param then doPlayerSendCancel(cid, "The time inserted is invallid.") doSendMagicEffect(getPlayerPosition(cid), 2) return true end if getPlayerMoney(cid) < param*money then doPlayerSendCancel(cid, "You don't have enought money.") doSendMagicEffect(getPlayerPosition(cid), 2) return true end if getTilePzInfo(getCreaturePosition(cid)) then if param <= maxminute and getPlayerStorageValue(cid, 86867) == -1 then local eventid1 = addEvent(doTeleportThing, param*1000*60, cid, endpos) setPlayerStorageValue(cid, 85856, eventid1) local eventid2 = addEvent(setPlayerStorageValue, param*1000*60, cid, 86867, -1) setPlayerStorageValue(cid, 85857, eventid2) local eventid3 = addEvent(doPlayerSendTextMessage, param*1000*60, cid, 27, "Time is gone") setPlayerStorageValue(cid, 85858, eventid3) local eventid4 = addEvent(doSendMagicEffect, param*1000*60, getPlayerPosition(cid), 10) setPlayerStorageValue(cid, 85859, eventid4) setPlayerStorageValue(cid, 86867, 1) doTeleportThing(cid, trainerpos) doPlayerRemoveMoney(cid, param*1000) doPlayerSendTextMessage(cid, 27, "You bought "..param.." minutes at trainers.") doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid, "The maximum possible time is 40 minutes.") doSendMagicEffect(getPlayerPosition(cid), 2) return true end else doPlayerSendCancel(cid, "You need to be protection zone.") doSendMagicEffect(getPlayerPosition(cid), 2) return true end else if param == "off" and getPlayerStorageValue(cid, 86867) == 1 then stopEvent(getPlayerStorageValue(cid, 85856)) stopEvent(getPlayerStorageValue(cid, 85857)) stopEvent(getPlayerStorageValue(cid, 85858)) stopEvent(getPlayerStorageValue(cid, 85859)) doPlayerSendTextMessage(cid, 27, "You left the trainers, so long reset.") setPlayerStorageValue(cid, 86867, -1) doTeleportThing(cid, endpos) doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid, "You're already in trainers") doSendMagicEffect(getPlayerPosition(cid), 2) end end return true end
Siga as configurações do script , mto simples de ser configurado.
Tag :
<talkaction words="!trainer" event="script" value="trainer.lua"/>
Reporte Bugs ou elogios , no tópico...