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:
Bugs or any problems send me pm
<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