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

[Script] PACC per hours... not days !

Kubik213

New Member
Joined
Apr 2, 2009
Messages
29
Reaction score
0
Hello,
I need script, that pacc will be counted for hours, not days! It will be counting when you are logged in, when you are logged out, it won't acting...

for example, you have 15 hours of pacc, and when you play one day, 5 hours, you have 10 hours next day :p

yea.. sry for my bad english, because i have written it very fast....
 
A PACC based on played time. Smart idea, this way you can benefit as much as possible, even if you are an inactive user.

Also, PACC played time = less botting, since botters don't want to loose so much time with their premium account I guess? :p

But sorry can't help you though.
 
Well searching the many archive's I figured out how to use the onthink events have to be registered threw onlogin but its not a burden.

add to creaturesscripts.xml
Code:
<event type="think" name="think" event="script" value="premcount.lua"/>

In the scripts create a file called premcount.lua

Code:
local storage = 50000

function onThink(cid, interval)
	time = getPlayerStorageValue(cid,storage)
	doCreatureSay(cid, interval, TALKTYPE_ORANGE_1)
	if time > 0 then
		time = time - 1
		setPlayerStorageValue(cid,storage,time)
	end
end

now edit the file login.lua in the creaturesscripts
red text is new text
Code:
function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
			doPlayerSetLossPercent(cid, i, loss)
		end
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "PlayerDeath")
	[COLOR="Red"]registerCreatureEvent(cid, "think")[/COLOR]
	return TRUE
end
This will actually happen every second and will get a even more accurate count of there online time.
then you just anything you need premium for then you would just do a check on the storage value
 
Back
Top