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

[TFS 1.2] Clean Script Global Event FIX problem

diakosz3456

New Member
Joined
Apr 6, 2020
Messages
46
Reaction score
1
Hello, i have this script but it doesn't works :c help plz
globalevents/scripts/clean.lua
Code:
local cleanEvent = 0

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wyczyszczono " .. doCleanMap() .. " przedmiotow.")
        return true
    end

    if(param == 'tile') then
        local removeLoadedFromMap = false
        local t = string.explode(param, ",")
        if(t[2]) then
            removeLoadedFromMap = getBooleanFromString(t[2])
        end

        doCleanTile(getCreaturePosition(cid), removeLoadedFromMap)
        return true
    end

    if(not tonumber(param)) then
        doPlayerSendCancel(cid, "Command requires numeric param.")
        return true
    end

    stopEvent(cleanEvent)
    prepareClean(tonumber(param), cid)
    return true
end

function prepareClean(minutes, cid)
    if(minutes == 0) then
        if(isPlayer(cid)) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wyczyszczono " .. doCleanMap() .. " przedmiotow.")
        end
        doBroadcastMessage("Game map cleaned.")
    elseif(minutes > 0) then
        if(minutes == 1) then
            doBroadcastMessage("Clean za " .. minutes .. " minut, prosze pozabierac swoje itemy z ziemi!.")
        else
            doBroadcastMessage("Clean za " .. minutes .. " minut.")
        end
        cleanEvent = addEvent(prepareClean, 60000, minutes - 1, cid)
    end
end
Post automatically merged:

globalevents.xml
Code:
<globalevent interval="7800000" name="clean" value="clean.lua" event="script"/>
 
Back
Top