Different share sizes for active or passive users
 

Different share sizes for active or passive users

Started by Jerry, 18 July, 2005, 19:40:06

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerry

Hello guys,

Can you somebody help me with the script: different share sizes for active or passive users (eg. for active users: 1GB and for passive users: 5GB)

Can you help me, please?

 Thank you in advance for help!

Madman

#1
-- Diff Share 4 Passive
-- Made by Madman
-- Request by Jerry

tConfig = {
	["Bot"] = "DiffShare", -- Name on the bot
	["PShare"] = 1, -- Share for passive. in GB
	["AShare"] = 170, -- share for Active. in GB
}

function NewUserConnected(curUser)
	if curUser.iProfile == 2 then
	else
		if curUser.bActive == nil then -- If passive
			if curUser.iShareSize/1024^3 <= tConfig.PShare then -- If bellow min Passive share
				curUser:SendData(tConfig.Bot, "You don't have enough share for a Passive user. Minimum us " ..tConfig.PShare.. " GB")
				curUser:Disconnect() -- Disconnet
			end
		else -- If active
			if curUser.iShareSize/1024^3 <= tConfig.AShare then -- If bellow min Active share
				curUser:SendData(tConfig.Bot, "You don't have enough share for a Active user. Minimum is " ..tConfig.AShare.. " GB")
				curUser:Disconnect() -- Disconnect
			end
		end
	end
end

There you go... This should do the trick... =)

*Edit*
Fixa a small bug... ;p
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Jerry

QuoteOriginally posted by madman

There you go...

OK :)
Thank you very much Madman!!!

SMF spam blocked by CleanTalk