local days = xxxx --- Days of prem
function onLogin(cid)
if isPlayer(cid) then
if getPlayerPremiumDays(cid) > 0 then
doPlayerAddPremiumDays(cid,days)
end
return true
end
end
<event type="login" name="Prem" event="script" value="Prem.lua"/>
registerCreatureEvent(cid, "Prem")
if getPlayerPremiumDays(cid) >= 1 then
if getPlayerPromotionLevel(cid) < 1 then
doPlayerSetPromotionLevel(cid, 1)
doSendMagicEffect(getCreaturePosition(cid),30)
doPlayerSendTextMessage(cid,22,"You have been promoted!")
end
end
local t = {
[1] = {"You are now a master sorcerer",5},
[2] = {"You are now an elder druid",6},
[3] = {"You are now a royal paladin",7},
[4] = {"You are now an elite knight",8}
}
function onLogin(cid)
ppos = getPlayerPosition(cid)
local v = t[getPlayerVocation(cid)]
if t then
if getPremiumDays >= 0 then
doPlayerSetVocation(cid,v[2])
doSendMagicEffect(ppos,5)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
setPlayerStorageValue(cid,7000,1)
elseif getPlayerStorageValue(cid,7000) > 0 then
doPlayerSendCancel(cid,"You have already been promoted")
end
return true
end
end
Use thisAdd somewhere into login.lua (after Function(........))
LUA:if getPlayerPremiumDays(cid) >= 1 then if getPlayerPromotionLevel(cid) < 1 then doPlayerSetPromotionLevel(cid, 1) doSendMagicEffect(getCreaturePosition(cid),30) doPlayerSendTextMessage(cid,22,"You have been promoted!") end end