Different share sizes for active or passive users
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

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