• 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!

Powazny problem z serwerm

zduna

Banned User
Joined
May 3, 2010
Messages
201
Reaction score
0
Jak to czesto bywa ktos znalazl blad w skryptach i zgrywa hakera

Przerzucilem serwer z 8.54 na 8.6 i najwidoczniej jakis skrypt nie gra
Jeden z graczy potwornie laguje serwer. Sprawa wyglada tak

Pisze na pw kiedy beda lagi, na niewidocznym stalem koloniego on nic nie robil. Zadnych talkactionow zadnych akcji
Przerzucilem jego postac na swoje konto zeby sprawdzic czy moze ma jakis item zbugowany i tez nic

Podejrzewalem jakis talkactions ale kazdy po kolei wrzucilem na hotkeya i spamowalem godem i nadal nic

Silnik zadnych bledow nie wyrzuca

Moze wiecie o co chodzi ?
 
stary, a masz exhaustedy na te talkactiony? bo to, że ty spamujesz hotkeyem nic nie znaczy, bo ktoś może spamować botem 10x szybciej ;s
po za tym pewnie jakieś błędy z libami npców masz czy coś
 
Może to być spam komendami, spamowanie kupowaniem u npc, przeszukaj też uważnie globaleventsy.
 
Raczej w talkactions jest blad. Moglby ktos dac podstawowe skrypty z tfsa z exhausted ? albo chociaz 1 to sobie dorobie reszte
 
Lua:
exhaustion =
{
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time()
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time()
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time() + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}

przykład: 10 sec exh. dla storage 12321 :)
Lua:
if exhaustion.check(cid, 12321) then
	doPlayerSendCancel(cid, "You are exhausted.")
	return FALSE
else
	exhaustion.set(cid, 12321, 10)
end
 
Code:
local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
    advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)
    if(not config.useFragHandler) then
        return false
    end



exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end
 
        return getPlayerStorageValue(cid, storage) >= os.time()
    end,
 
    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end
 
        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end
 
        return false
    end,
 
    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,
 
    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end
 
        return false
    end
}

    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}

    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end

    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    if(config.advancedFragList) then
        local result = "Frags gained today: " .. size.day .. "."
        if(size.day > 0) then
            for _, content in ipairs(contents.day) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
        if(size.week > 0) then
            for _, content in ipairs(contents.week) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
        if(size.month > 0) then
            for _, content in ipairs(contents.month) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
        end

        doPlayerPopupFYI(cid, result)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
        if(size.day > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
        end
    end

    return true
end

frags.lua


Co zle zrobilem ?
 
Last edited by a moderator:
frags.lua


Co zle zrobilem ?

to, że dodałeś klasę z funkcjami, która zapewne masz, sprawdź w libs czy nie masz pliku *-exhaustion.lua,
a jak masz to dodaj tylko to:
Lua:
if exhaustion.check(cid, 12321) then
	doPlayerSendCancel(cid, "You are exhausted.")
	return FALSE
else
	exhaustion.set(cid, 12321, 10)
end
pod function onSay(cid....) ;)
 
w data/lib nie mam
i w data/talkactions/lib tez nie
 
tylko w data/lib/050-function nigdzie nie ma onSay
 
dodane, ale nie smiga
co zrobic z tym ?

exhaustion =
{
check = function (cid, storage)
if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
return false
end

return getPlayerStorageValue(cid, storage) >= os.time()
end,

get = function (cid, storage)
if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
return false
end

local exhaust = getPlayerStorageValue(cid, storage)
if(exhaust > 0) then
local left = exhaust - os.time()
if(left >= 0) then
return left
end
end

return false
end,

set = function (cid, storage, time)
setPlayerStorageValue(cid, storage, os.time() + time)
end,

make = function (cid, storage, time)
local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
exhaustion.set(cid, storage, time)
return true
end

return false
end
}
 
dla pewnosci

Code:
local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
    advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)

if exhaustion.check(cid, 12321) then
    doPlayerSendCancel(cid, "You are exhausted.")
    return FALSE
else
    exhaustion.set(cid, 12321, 10)
end

    if(not config.useFragHandler) then
        return false
    end

    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}

    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end

    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    if(config.advancedFragList) then
        local result = "Frags gained today: " .. size.day .. "."
        if(size.day > 0) then
            for _, content in ipairs(contents.day) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
        if(size.week > 0) then
            for _, content in ipairs(contents.week) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
        if(size.month > 0) then
            for _, content in ipairs(contents.month) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
        end

        doPlayerPopupFYI(cid, result)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
        if(size.day > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
        end
    end

    return true
end

i wrzucilem do 050-function.lua drugi skrypt, ale exhausted nie ma
 
Last edited by a moderator:
Lua:
	if not(exhaustion.check(cid, 12321)) then
		exhaustion.set(cid, 12321, 10)
	else
		doPlayerSendCancel(cid, "You can commands once time in 10 seconds.")
		return false
	end
skopiowałem z mojego wara, u mnie działa sprawdź : )
a jakieś błędy w konsoli są?
 
dodalem wszystko i nadal exhausted nie ma, konsola zadnych bledow nie wyrzuca

dla pewnosci to na poczatku data/lib/050-function.lua

Code:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end
 
        return getPlayerStorageValue(cid, storage) >= os.time()
    end,
 
    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end
 
        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end
 
        return false
    end,
 
    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,
 
    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end
 
        return false
    end
}


a frags.lua mam tak

Code:
local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
    advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)

 if not(exhaustion.check(cid, 12321)) then
        exhaustion.set(cid, 12321, 10)
    else
        doPlayerSendCancel(cid, "You can commands once time in 10 seconds.")
        return false
    end

    if(not config.useFragHandler) then
        return false
    end

    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}

    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end

    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    if(config.advancedFragList) then
        local result = "Frags gained today: " .. size.day .. "."
        if(size.day > 0) then
            for _, content in ipairs(contents.day) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
        if(size.week > 0) then
            for _, content in ipairs(contents.week) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
        if(size.month > 0) then
            for _, content in ipairs(contents.month) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
        end

        doPlayerPopupFYI(cid, result)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
        if(size.day > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
        end
    end

    return true
end
 
Last edited by a moderator:
hmm, zrestartowałeś serwer? i sprawdzasz normalnym playerem? bo GM itd. mają flagę, że exhaust nie ma... :p
 
rzeczywicie ;) dziala elegancko wielkie dzieki

Teraz do kazdego skryptu wystarczy dodac ?
Code:
 if not(exhaustion.check(cid, 12321)) then
        exhaustion.set(cid, 12321, 10)
    else
        doPlayerSendCancel(cid, "You can commands once time in 10 seconds.")
        return false
    end
 
Last edited by a moderator:
Back
Top