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

CreatureEvent Premium Expires Warning

Qwe

Banned User
Joined
May 19, 2009
Messages
122
Reaction score
8
Location
$user->getLocation();
Hello all, I made easy scripts for warn player if his premium time are exires in X days. Warning is in popup form.

- Easy Config!
- Easy installation!

How to install?
1. Add at top of login.lua[in data/creaturescripts/scripts] this code:
PHP:
config = { 
	enableWarning = true,
	pzlockCheck = true,
	days = 3,
	waitTime = 5,
	buyPACCSite = "http://myots.net/"
}

function premiumWarning(cid)
	if(not enableWarning)then return true end
	if(config.pzlockCheck and isPlayerPzLocked(cid))then return true end
	if(isPremium(cid) and not getPlayerAccountManager(cid))then
		if(getPlayerPremiumDays(cid) <= conf.days and not getConfigValue("freePremium"))then
			str = "You Premium account expires in less than "..config.days.." days!!!\n"
			str = str.."In the case of the end of premium account you will lose:\n"
			str = str.." - Own house[All items has been transfered to house city depot]\n"
			str = str.." - Possiblity of set Premium outfits and addons\n"
			str = str.." - Access to premium areas and premium boats\n"
			str = str.." - Promotion, and such more of premium extras!\n"
			str = str.."\n To add premium time go to server website: "..config.buyPACCSite
			doPlayerPopupFYI(cid, str)
		end
	end
	return true
end

2.in same file, under
PHP:
 function onLogin(cid)
add code:
PHP:
addEvent(premiumWarning, config.waitTime, cid)

3. Reload creaturescripts, and works!


Config Settings
Ok, you have put config section in login.lua, its a this array:
PHP:
config = { 
	enableWarning = true,
	pzlockCheck = true,
	days = 3,
	waitTime = 5,
	buyPACCSite = "http://myots.net/"
}
You can easy set:
- enableWarning = true/false - scripts enable or disable

- pzlockCheck = true/false - don't popup player if is pzlocked [on true]

- days = XXX - how many days before premiums end popup warns player

- waitTime = 5 - how many seconds after login warn [default is 5, for better pz check(if player is attacked etc)]

- buyPACCSite = http://xxx - server site adres, for buy premium time.

And it's all!
Thanks, Qwe.
 
Great Job =) Can you Make same shit but for Vip XD Vip days bla bla expire :p
 
Lua:
local config = {  
    StorageForPremium = 1000,
    enableWarning = true, 
    pzlockCheck = true, 
    days = 3, 
    waitTime = 5, 
    buyPACCSite = "http://myots.net/",
} 
local days = 3,
str = config.StorageForPremium,
}
function premiumWarning(cid) 
    if(not enableWarning)then return true end 
    if(config.pzlockCheck and isPlayerPzLocked(cid))then return true end 
    if(isPremium(cid) and not getPlayerAccountManager(cid))then 
        if(getPlayerPremiumDays(cid) <= conf.days and not getConfigValue("freePremium"))then 
 if getPlayerStorageValue(cid, #str,#days) then 
            str = "You Premium account expires in less than "..config.days.." days!\n" 
            str = str.."In the case of the end of premium account you will lose:\n" 
            str = str.." - Own house[All items has been transfered to house city depot]\n" 
            str = str.." - Possiblity of set Premium outfits and addons\n" 
            str = str.." - Access to premium areas and premium boats\n" 
            str = str.." - Promotion, and such more of premium extras!\n" 
            str = str.."\n To add premium time go to server website: "..config.buyPACCSite 
            doPlayerPopupFYI(cid, str) 
        end 
    end 
    return true 
end
 
Last edited:
Back
Top