• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Porządki w datapack

gameover99097

Banned User
Joined
Nov 19, 2010
Messages
270
Reaction score
4
Mam tu pare nie pewnych plików , chce tylko znać znaczenie i czy nie na robi syfu .

Folder actions

addon.lua

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerStorageValue(cid, 4767) == EMPTY_STORAGE) then
		doCreatureSay(cid, "You have gained your new outfit and may leave the reward room now!", TALKTYPE_ORANGE_1)
		doPlayerAddOutfit(cid, 336, 0)
		doPlayerAddOutfit(cid, 335, 0)
		setPlayerStorageValue(cid, 4767, 1)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
	else
		doPlayerSendTextMessage(cid,22,"You have already gained your new outfit. You may leave the room now.")
	end
	return true
end

globalevents

noDDos.lua

Code:
  ------ DDoS protection
------ By Mock
------ Require Lua socket
local conf = {
      check_website1 = 'http://www.google.com/', ---- First website
      check_website2 = 'http://pt.wikipedia.org/', ---- Second website
      ifoff = { --- If this 2 websites was offline
            kickall = true, --- Kick all players?
            save = true, --- Save server?
            closeserver = true, --- Exit server?
      }
}
--[[
This script every X seconds will check if google is online,
if google is off it will check wikipedia, if wikipedia is
off too is because your net is verry overloaded (DDoS attack)
or your connection is down. If all this is off this script
will kick all players, save server and close server.
]]
function onThink(interval, lastExecution)
    assert(socket,'Please install socket!')
    assert(socket.http,'Please install socket.http')
    local re,info,kind = pcall(socket.http.request,conf.check_website1)
    if not info or re == false then
       print('::Google is off?\a')
       if conf.check_website2 and conf.check_website2 ~= '' and conf.check_website2:len() > 6 then
          local re,info,kind = pcall(socket.http.request,conf.check_website2)
          if not info or re == false then
             print('::We are under attack or you connection is offline!\a\a')
             if conf.ifoff.kickall == true then
                for i,b in pairs(getOnlinePlayers()) do
                    doRemoveCreature(b)
                end
             end
             if conf.ifoff.save == true then
             saveServer()
             end
             if conf.ifoff.closeserver == true then
             os.sleep(2)
             os.exit()
             end
          end
       end
    end
        return TRUE
end

lottery.lua

Code:
  -- by vDk, klekSu
local config = {
    lottery_hour = "3 Hours", -- Time to next lottery (real time you set on globalevents.xml, its only for broadcast message.)
    rewards_id = {2494, 2472, 2514, 2160}, -- Rewards ID
    crystal_counts = 10, -- used only if on rewards_id you have crystal coins (ID: 2160).
    website = "yes" -- Do you have `lottery` table in your database?
    }
function onThink(interval, lastExecution)
    local players = getPlayersOnline()
    local list = {}
    for i, tid in ipairs(players) do
    list[i] = tid
end
        local winner = list[math.random(1, #list)]
        local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
        local item_name =  getItemNameById(random_item)
        local world = tonumber(getPlayerWorldId(winner))
                if(random_item == 2160) then
                        doPlayerAddItem(winner, random_item, config.crystal_counts)
                        doBroadcastMessage('[LOTTERY SYSTEM] Winner: '.. getCreatureName(winner) ..', Reward: '.. config.crystal_counts ..' '.. item_name ..'s! Congratulations! (Next Lottery in '.. config.lottery_hour ..')')
                else
                        doBroadcastMessage('[LOTTERY SYSTEM] Winner: '.. getCreatureName(winner) ..', Reward: '.. item_name ..'! Congratulations! (Next Lottery in '.. config.lottery_hour ..')')
                        doPlayerAddItem(winner, random_item, 1)
                end
                if(config.website == "yes") then
                        db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. item_name .."', '".. world .."');")
                end
    return TRUE
end
 
1. To quest na addona,
2. Może się przydać,
3. To nie czasem ta dziurawa wersja?( nie chce mi się sprawdzać ).
 
skrypty proste jak swinski ogon... trudno zeby cos nie poszlo


a skrypt numer 2 wydaje mi sie, ze jedynie zasmieca serwer i tak, raczej licha oslona przed DoS...
zadziala tylko przy przeciazeniu lacza, przy przeciazeniu maszyny nic nie da. Poza tym sama nazwa "noDDoS" wyolbrzymia mozliwosci skryptu bo nie robi nic z przyczyna, a moze jedynie zlagodzic konsekwencje
 
Last edited:
To ty robisz server a nie my ty decydujesz czy chcesz miec te skrypty czy nie. My mozemy Ci tylko doradzic czy skrypt dziala jak powinnien. Mozemy rowniez pomoc w napisaniu skryptu nakierowaniu w czym tkwi problem.
I to pytanie jakie to ma znaczenie... Juz te nazwy powinny dac Ci do zorumienia co robia te skrypty. A czy zasmiecaja czy nie zasmiecaja to juz indywidualne spojrzenie na skrypt

Jak to powiedzial Samme: "Jak twoja zona zacznie rodzic tez sie zapytasz co masz robic na polish broadzie?"
 
Back
Top