TomCrusher
Jeg er ingenting
Hello how to set time of expires for set player storage on real time? I think about scroll some get you promotion but only for 2 weeks, how to set it???
I'm newbie and wrote first my script like this but dont work <_<
Who can help me?
Thanks a lot.:blink:
I'm newbie and wrote first my script like this but dont work <_<
Who can help me?
PHP:
local config = {
promotion = 2, -- promotion level, default = 2 . Ignore if you don't have new vocations.
oldpromotion = 1, -- back promotion level, default = 2
MaxTime = 20, --max time of promotion
TimeStor = 18009 --here will be saved the time.
}
local disabledVocations = {0}
config.premium = getBooleanFromString(config.premium)
function onUse(cid, item, frompos, param, topos)
if item.itemid == 9004 then
setPlayerPromotionLevel(cid, config.promotion)
doPlayerRemoveItem(cid, 9004, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
setPlayerStorageValue(cid, config.TimeStor, config.MaxTime)
end
local PlayerTime = getPlayerStorageValue(cid, config.TimeStor)
if PlayerTime - 10 <= os.time() then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "you have "..PlayerTime - os.time().." seconds left.!")
elseif PlayerTime == 0 <=os.time() then
setPlayerPromotionLevel(cid, config.oldpromotion)
end
return TRUE
end