Ir para conteúdo

Johnny001

Campones
  • Total de itens

    8
  • Registro em

  • Última visita

Sobre Johnny001

Informações

  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    OT-Admin

Últimos Visitantes

820 visualizações

Johnny001's Achievements

  1. Ok, obg pela dica já vou arrumar pois é meu primeiro post Arrumado !! Te Ajudei ? REP + !! Não Vai Cair O Dedo !!
  2. Aew Galera XTibiana estou aki pra mostrar o Sistema de Loteria. Vamos Começar : 1° Abra a pasta do seu OT 2° Vá em data/globalevents/scripts 3° Crie um arquivo .lua chamado lottery 4 ° e coloque isso -- Lottery System local config = { lottery_hour = "30 minutos", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards_id = {2160}, -- ID dos Itens Sorteados na Loteria crystal_counts = 100, -- Usado somente se a rewards_id for crystal coin (ID: 2160). website = "no" -- Only if you have php scripts and table `lottery` in your database! } function onThink(interval, lastExecution) if(getWorldCreatures(0) == 0)then return true end local list = {} for i, tid in ipairs(getPlayersOnline()) do list[i] = tid end local winner = list[math.random(1, #list)] local random_item = config.rewards_id[math.random(1, #config.rewards_id)] if(random_item == 2160) then doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[Loteria] Ganhador: " .. getCreatureName(winner) .. ", você ganhou: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! parabéns! (Proxima Loteria em " .. config.lottery_hour .. ")") else doBroadcastMessage("[Loteria] Ganhador: " .. getCreatureName(winner) .. ", você ganhou: " .. getItemNameById(random_item) .. "! Parabéns! (Proxima Loteria em " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');") end return true end 5° Vá em data/globalevents/globalevents.xml 6° e coloque isto : <globalevent name="lottery" interval="2400" script="lottery.lua"/>
  3. Aew pessoal do XTibia estou postando um system que achei mt legal, o Car System entao vamos lá !! Abra a pasta do seu ot e vá em Data/Talkactions/Scripts crie um arquivo .lua chamado car e ponha : --<< Configurable >>-- local storages = { speed = 314622, status = 352993 } -- Empty storages local cfg = { min_speed = 300, -- better not increase than that [ the least speed for a car ] max_speed = 200, -- better not decrease than this [ the maximum speed for a car ] Increase_per_command = 100, -- The speed increase or decrease value per each command (!car speed // !car slow) Car_Explode = true -- Keep it true , so your map isnt filled with cars } -->> END <<-- --<< Functions >>-- function isWalkable(pos, creature, pz)-- Modificações by Hudsin,Arkires e Pinpao Xtibia if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function getCarSpeed(cid) return getPlayerStorageValue(cid,storages.speed) end function setCarSpeed(cid,value) return setPlayerStorageValue(cid,storages.speed, getPlayerStorageValue(cid,storages.speed) + value) end function setCarStatus(cid,value) return setPlayerStorageValue(cid,storages.status,value) end function carMove(cid) return getPlayerStorageValue(cid,storages.status) > 0 and true or false end function move(cid,time) local dir = getCreatureLookDir(cid) local id = isInArray({1,3},getCreatureLookDir(cid)) and 7267 or 7266 local place = getPositionByDirection(getThingPos(cid),dir,1) if isWalkable(place,true,true,true) then doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 0 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) doTeleportThing(cid,place,false) addEvent(doSendMagicEffect,time+10,place,34) doCreateItem(id,1,place) if carMove(cid) then addEvent(move,time,cid,getCarSpeed(cid)) else doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 0 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) end else doCreatureSetNoMove(cid, 0) doPlayerSendTextMessage(cid,27,"You have hit somthng.") setCarStatus(cid,0) if cfg.Car_Explode then doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 1 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) doSendAnimatedText(getThingPos(cid),"Crashed",TEXTCOLOR_RED) doSendMagicEffect(getThingPos(cid),31) end end end --<< Functions Ends <<-- function onSay(cid, words, param, channel) if param == "speed" then if carMove(cid) then if getCarSpeed(cid) > cfg.max_speed then setCarSpeed(cid,-(cfg.Increase_per_command)) addEvent(doSendAnimatedText,10,getThingPos(cid),"Speeding",TEXTCOLOR_GREEN) else setCarSpeed(cid,cfg.max_speed) doPlayerSendCancel(cid,"You car.") end else doPlayerSendCancel(cid,"You should start moving first.") end elseif param == "slow" then if carMove(cid) then if getCarSpeed(cid) < cfg.min_speed then setCarSpeed(cid,cfg.Increase_per_command) addEvent(doSendAnimatedText,10,getThingPos(cid),"Slowing",TEXTCOLOR_GREEN) else setCarSpeed(cid,cfg.min_speed) doPlayerSendCancel(cid,"The car is in its minumium speed.") end else doPlayerSendCancel(cid,"You should start moving first.") end elseif param == "stop" then -- by DarkVelocity Xtibia if carMove(cid) then setCarStatus(cid,0) doCreatureSetNoMove(cid, 0) else doPlayerSendCancel(cid,"Car is already stopped.") end elseif param == "move" then if not carMove(cid) then if getTileItemById(getThingPos(cid),7267).uid < 1 and getTileItemById(getThingPos(cid),7266).uid < 1 then local item = isInArray({1,3},getCreatureLookDir(cid)) and 7267 or 7266 doCreateItem(item,1,getThingPos(cid)) end setPlayerStorageValue(cid,storages.speed,cfg.min_speed) setCarStatus(cid,1) doCreatureSetNoMove(cid, 1) move(cid,getCarSpeed(cid)) else doPlayerSendCancel(cid,"Car is already moving.") end end return true end Depois vá em Talkactions/talkactions.xml e ponha : <talkaction words="!car" event="script" value="car.lua"/> OBS :Esse system ele usa um treno para andar em cima dele como se fosse um carro é mt legal !! Espero que tenha ajudado !! Descupem se estiver mal organizado ou ruim podem colocar oque quiserem na resposta pois este é meu primeiro topico !! Te Ajudei ? REP + !! Não Vai Cair O Dedo !!
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...