Dilio
Owner of Project Thala
Forgot to add instructions.
Step 1 -
Go to talkactions.
Step 2 -
Open talkactions.xml
Step 3 -
Go to your players section and add:
Step 4 -
Go to talkaction scripts.
Step 5 -
Create savecharacter.lua
Step 6 -
Finally add this code:
Step 7 -
Go to your lib folder, and at the end of data.lua
Add:
Step 8 -
Save and your done.
Basically what this does is it saves the player without them having to logout, and I also added in a delay so it can't be spammed.
Useful if the player gets a Donation item and doesn't want to relog, or has PZ.
Default delay is 30 seconds.
Newest script (updated at last edit) - Will now tell you how many more seconds you need to wait, and uses a storage value as the exhaust. (Thanks again Slawkens and Zonet for the bit of codes)
Credits:
Me(Script)
Sizaro(Idea)
JDB and chris77(Fixing a bit)
Zonet(Idea/Fixing a bit)
Slawkens(exhaustion)
Step 1 -
Go to talkactions.
Step 2 -
Open talkactions.xml
Step 3 -
Go to your players section and add:
Code:
<talkaction words="!save" event="script" value="savecharacter.lua"/>
Go to talkaction scripts.
Step 5 -
Create savecharacter.lua
Step 6 -
Finally add this code:
Lua:
local waittime = 30 --Default (30 seconds)
local storage = 5560
function onSay(cid, words, param, channel)
if exhaustion.get(cid, storage) == FALSE then
doPlayerSave(cid)
exhaustion.set(cid, storage, waittime)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully saved your character.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. exhaustion.get(cid, storage) .. " seconds.")
end
return TRUE
end
Go to your lib folder, and at the end of data.lua
Add:
Lua:
dofile(getDataDir() .. "lib/exhaustion.lua")
Save and your done.
Basically what this does is it saves the player without them having to logout, and I also added in a delay so it can't be spammed.
Useful if the player gets a Donation item and doesn't want to relog, or has PZ.
Default delay is 30 seconds.
Newest script (updated at last edit) - Will now tell you how many more seconds you need to wait, and uses a storage value as the exhaust. (Thanks again Slawkens and Zonet for the bit of codes)
Credits:
Me(Script)
Sizaro(Idea)
JDB and chris77(Fixing a bit)
Zonet(Idea/Fixing a bit)
Slawkens(exhaustion)
Last edited: