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

!saveme

alvo

New Member
Joined
Oct 20, 2009
Messages
45
Reaction score
0
Someone could help me with this script?
player says : !saveme

and the progress will be saved
=)
 
why not the simple way?
LUA:
local config = {
    storage = 44555,
    exhaust = 10 -- Seconds
}

function onSay(cid, words, param, channel)
    if exhaustion.check(cid, config.storage) then
        doPlayerSendCancel(cid, 'You can\'t use this command yet['..exhaustion.get(cid, config.storage)..'].')
        return true
    else
        exhaustion.set(cid, config.storage, config.exhaustion)
    end

    doPlayerSave(cid, true)
    return true
end
 
exhaustion.set, etc.. is deprecated in 0.3.6pl1, some reason it doesn't work for me.

Code:
local config = {
    storage = 44555,
    exhaust = 10 -- Seconds
}

function onSay(cid, words, param, channel)
    if getPlayerStorageValue(cid, config.storage) > os.time() then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, config.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, config.storage) - os.time()) == 1 and "" or "s") .. ".")
        return true
    end
        
    doPlayerSave(cid, true)
    setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust)
    return true
end
 
Last edited:
Back
Top