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

[Request] 365 Days of Premium onLogin

justin234

New Member
Joined
Jan 22, 2008
Messages
999
Reaction score
4
When a Player logs on, I want there premium days to be set to 365.

Everytime they log on, it keeps the days at 365.

Thanks!
 
This would make sure that the days stays at 365 and won't go past it.
PHP:
function onLogin(cid)
    local newPremDays = 365 - getPlayerPremiumDays(cid)
    doPlayerAddPremiumDays(cid, newPremDays)
    
    registerCreatureEvent(cid, "PlayerDeath")
    return TRUE
end
 
This would make sure that the days stays at 365 and won't go past it.
PHP:
function onLogin(cid)
    local newPremDays = 365 - getPlayerPremiumDays(cid)
    doPlayerAddPremiumDays(cid, newPremDays)
    
    registerCreatureEvent(cid, "PlayerDeath")
    return TRUE
end

I now have 733 pemium days...

I want it were if he logs on, itll be set to 365.
After 365 is gone, it will give him 365 again.

thanks
 
Alright, how about this one then? o_o
PHP:
function onLogin(cid)
    if getPlayerPremiumDays(cid) > 365 then
        doPlayerAddPremiumDays(cid, - getPlayerPremiumDays(cid))
        doPlayerAddPremiumDays(cid, 365)
    else
        local newPremDays = 365 - getPlayerPremiumDays(cid)
        doPlayerAddPremiumDays(cid, newPremDays)
    end
    
    registerCreatureEvent(cid, "PlayerDeath")
    return TRUE
end
 
@Zonet,
Yours works I think, but it only happens once.
So after 1 year, they wont have free premmy anymore.

@Macroman,
Ill test later when I get home.
 
Nope, there isnt anything like that in the config.
Its 7.6 Avesta.

Also:
Does anyone know how to get soft boots working?
Right now they just debug when I remove them from feet...
 
Alright, how about this one then? o_o
PHP:
function onLogin(cid)
    if getPlayerPremiumDays(cid) > 365 then
        doPlayerAddPremiumDays(cid, - getPlayerPremiumDays(cid))
        doPlayerAddPremiumDays(cid, 365)
    else
        local newPremDays = 365 - getPlayerPremiumDays(cid)
        doPlayerAddPremiumDays(cid, newPremDays)
    end
    
    registerCreatureEvent(cid, "PlayerDeath")
    return TRUE
end

Im nab scripter but wouldnt ur script mean that the script check for players with 365 pacc daysand above already?

and about the when its gone cant u just write elseif getPlayerPremiumDays(cid) == 0(or 1) then
doPlayerAddPremiumDays(cid, 365)
 
My script would remove all premium days if it's above 365 and then add 365 new ones. If it's below 365 though it would only add the remaining days to reach 365. Because that's how I understood his post to be, that it should always be 365.
 
Code:
doPlayerAddPremiumDays(cid, - getPlayerPremiumDays(cid))
        doPlayerAddPremiumDays(cid, 365)

this looks like it gives him the difference of 365 and momentanly pacc days and after that it gives him 365 more...

Thats why justin get around 700 pacc days

cant you just do a local paccdays = 365 and then

Code:
doPlayerAddPremiumDays(cid, paccdays - getPlayerPremiumDays(cid))

if its totally nabbish just excuse me im still nabby xD
 
Code:
doPlayerAddPremiumDays(cid, - getPlayerPremiumDays(cid))
        doPlayerAddPremiumDays(cid, 365)
this looks like it gives him the difference of 365 and momentanly pacc days and after that it gives him 365 more...

Thats why justin get around 700 pacc days

cant you just do a local paccdays = 365 and then

Code:
doPlayerAddPremiumDays(cid, paccdays - getPlayerPremiumDays(cid))
if its totally nabbish just excuse me im still nabby xD
doPlayerAddPremiumDays(cid, - getPlayerPremiumDays(cid))
doPlayerAddPremiumDays(cid, 365)


First it removes all the premium days it already has, removePrem(-getPrem) and after that it adds another 365 premium days. Justin used my former script which gave him 700 days~.
 
Ah kk

Now i know a bit more about Lua xDDD

its fun to do Lua but when I see colandus script for example my head is blowing lol its so freaking complicately written sometimes but well
trying to improve all the way

cya :)
 
Back
Top