Qwe
Banned User
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:
2.in same file, under
add code:
3. Reload creaturescripts, and works!
Config Settings
Ok, you have put config section in login.lua, its a this array:
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.
- 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)
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/"
}
- 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.