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

TalkAction TFS 0.4 Otx and 0.x versiosn Reduce Lag Saving PLayers & Houses

MartK

Active Member
Joined
Dec 6, 2018
Messages
63
Solutions
1
Reaction score
28
Its soo simple only need add tag in talkactions.xml:
<talkaction words="/save" event="script" value="SavePlayer.lua"/>

Later Go to your data, Talkactions/Scripts/
And Create a file lua, with the name Saveplayer.lua
and Add this code:
Code:
>Nitrox>
local Configs = {
    Exhausted = 180,
    Storage_Exhausted = 300000,
    Messages = {
        SALVED = "You character its salved.",
    
    },
}

local function doSavePlayerAndHouse(cid)
    doPlayerSave(cid)
    if getHouseByPlayerGUID(getPlayerGUID(cid)) then
        doSaveHouse(getHouseByPlayerGUID(getPlayerGUID(cid)))
    end
    return true
end

function onSay(cid, words, param)
    if getPlayerStorageValue(cid, Configs.Storage_Exhausted) >= os.time() then
        doPlayerSendCancel(cid, string.format(Configs.Messages.EXHAUST, getPlayerStorageValue(cid, Configs.Storage_Exhausted) - os.time()))
        return true
    end
    doSavePlayerAndHouse(cid)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, Configs.Messages.SALVED)
    setPlayerStorageValue(cid, Configs.Storage_Exhausted, os.time() + Configs.Exhausted)
    return true
end

Bugs or any problems send me pm
 
did you tested it? why don't you make a PR in the otx's github to fix this?
 
did you tested it? why don't you make a PR in the otx's github to fix this?
Doesn't seem to save all players on the server, just the person whom uses the command.

Not sure how this would make it lag less, since the regular save would still lag the server like normal.
 
Back
Top