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

If online 1 hour

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,394
Reaction score
162
IF player is online 30 min he gets message "your soul has been Refilled by gods becouse you play ! in another 30 min your soul will be refilled again !" with this message player gets 200 soul recieves
i use 0.4

Thannks in advance , Sorry for broken english :)
 
Last edited:
why do you think i care ?
Because my fake angry post made you think about caring, therefore you cared to comment, and forced you to post your login.lua to show how much you didn't care.
Got everything I wanted, and now you got what you want, below.
Code:
local config = {
     loginMessage = getConfigValue('loginMessage')
}

function addTimedSoul(cid)
     if not isPlayer(cid) then
         return true
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your soul has been Refilled by gods because you play ! In another 30 min your soul will be refilled again !")
     doPlayerAddSoul(cid, 200)
     addEvent(addTimedSoul, 30 * 60 * 1000, cid)
end

function onLogin(cid)
     if getCreatureName(cid) == "Account Manager" then
         doRemoveCreature(cid)
         return true
     end
     local loss = getConfigValue('deathLostPercent')
     if(loss ~= nil) and getPlayerVocation(cid) ~= 0 then
         doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
         setPlayerStorageValue(cid, 65535, -1)
         setPlayerStorageValue(cid, 788989, -1)
     end
   
     local buffs = {CONDITION_HASTE, CONDITION_ATTRIBUTES, CONDITION_REGENERATION}
     for i = 1,#buffs do
         if hasCondition(cid, buffs[i]) then
             doRemoveCondition(cid, buffs[i])
         end
     end
   
     addEvent(addTimedSoul, 30 * 60 * 1000, cid)
   
     local accountManager = getPlayerAccountManager(cid)
     if(accountManager == MANAGER_NONE) then
         local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
         if(lastLogin > 0) then
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
             str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
         else
             str = str .. " Please choose your outfit warfarian."
             doPlayerSendOutfitWindow(cid)
         end
     
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
     elseif(accountManager == MANAGER_NAMELOCK) then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
     elseif(accountManager == MANAGER_ACCOUNT) then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
     else
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
     end
   
     if(not isPlayerGhost(cid)) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
     end
   
     registerCreatureEvent(cid, "Mail")
     registerCreatureEvent(cid, "GuildMotd")
     registerCreatureEvent(cid, "Idle")
     registerCreatureEvent(cid, "antirain")
     --registerCreatureEvent(cid, "SoulGift")
     return true
end
 
works wonderfull , if i add more fucnions like this it wont lag/crash the server ? :)

aswell how i can add lvl to recieve g=this gift (so if you are llvl 100-500 you recieve gift or so
 
works wonderfull , if i add more fucnions like this it wont lag/crash the server ? :)

aswell how i can add lvl to recieve g=this gift (so if you are llvl 100-500 you recieve gift or so
exactly the same way but you change give soul to give item
@Limos does the function stop when a player logs out? like i log in, it queues the function 30m after i log in, i log out after 20 and log back in, will i not get the soul after 10 minutes then? and then after 30 cause i logged in again?
 
exactly the same way but you change give soul to give item
@Limos does the function stop when a player logs out? like i log in, it queues the function 30m after i log in, i log out after 20 and log back in, will i not get the soul after 10 minutes then? and then after 30 cause i logged in again?
i already did items and so but cant add lvl ^^
 
Because my fake angry post made you think about caring, therefore you cared to comment, and forced you to post your login.lua to show how much you didn't care.
Got everything I wanted, and now you got what you want, below.
Code:
local config = {
     loginMessage = getConfigValue('loginMessage')
}

function addTimedSoul(cid)
     if not isPlayer(cid) then
         return true
     end
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your soul has been Refilled by gods because you play ! In another 30 min your soul will be refilled again !")
     doPlayerAddSoul(cid, 200)
     addEvent(addTimedSoul, 30 * 60 * 1000, cid)
end

function onLogin(cid)
     if getCreatureName(cid) == "Account Manager" then
         doRemoveCreature(cid)
         return true
     end
     local loss = getConfigValue('deathLostPercent')
     if(loss ~= nil) and getPlayerVocation(cid) ~= 0 then
         doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
         setPlayerStorageValue(cid, 65535, -1)
         setPlayerStorageValue(cid, 788989, -1)
     end
  
     local buffs = {CONDITION_HASTE, CONDITION_ATTRIBUTES, CONDITION_REGENERATION}
     for i = 1,#buffs do
         if hasCondition(cid, buffs[i]) then
             doRemoveCondition(cid, buffs[i])
         end
     end
  
     addEvent(addTimedSoul, 30 * 60 * 1000, cid)
  
     local accountManager = getPlayerAccountManager(cid)
     if(accountManager == MANAGER_NONE) then
         local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
         if(lastLogin > 0) then
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
             str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
         else
             str = str .. " Please choose your outfit warfarian."
             doPlayerSendOutfitWindow(cid)
         end
    
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
     elseif(accountManager == MANAGER_NAMELOCK) then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
     elseif(accountManager == MANAGER_ACCOUNT) then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
     else
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
     end
  
     if(not isPlayerGhost(cid)) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
     end
  
     registerCreatureEvent(cid, "Mail")
     registerCreatureEvent(cid, "GuildMotd")
     registerCreatureEvent(cid, "Idle")
     registerCreatureEvent(cid, "antirain")
     --registerCreatureEvent(cid, "SoulGift")
     return true
end
you are such a good person, I do not care about those f*ckers
 

Similar threads

Back
Top