Share Checker for registered
 

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

Share Checker for registered

Started by Punkie, 27 January, 2004, 17:46:09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Punkie

I need help, please
.
I have a Ptoka 0.3.3.0 15.25 and I need script, which will check share only of registered users. No of other users.

Is it possible?

Ptoka checks share of non-registered users...and I have in Profile manager: Reg-no share limit...but I need to check their share, but they should have other share then non-registered users.

Sorry for my english.

c h i l l a

a simple one also extendable if you know how ;)

--Number in Gigabytes

shareProfiles = {
	[3] = "6",
}



function Main()
	for i,v in shareProfiles do
		shareProfiles[i] = v*1024*1024*1024
	end
end


function NewUserConnected(curUser)
	if shareProfiles[curUser.iProfile] then
		local infostring = curUser.sMyInfoString
		if not ( strsub(infostring,strlen(infostring),strlen(infostring)) == "|" ) then
			infostring = infostring.."|"
		end
		local _,_,share = strfind(curUser.sMyInfoString,"%$(%d+)%$|$")
		if tonumber(share) then
			if tonumber(share) < shareProfiles[curUser.iProfile] then
				curUser:Disconnect()
			end
		else
			curUser:Disconnect()
		end
	end
end

Punkie

Thanks a lot...it works! :-)
Can I ask you for one another help...?

I would like to send to registered user...if he will be disconected...why he is disconected.

Something like:

SendToNick(curUser.sName," You don't met the share minimum x Gb")

If I put it into script...it doesnt work.
I am a beginner :-/.

c h i l l a

yepp I also made a little mistake inthe script, and it worked with you??

what ptokax are you using ??

--Number in Gigabytes

shareProfiles = {
	[3] = "6",
}

function Main()
	for i,v in shareProfiles do
		shareProfiles[i] = v*1024*1024*1024
	end
end

function NewUserConnected(curUser)
	if shareProfiles[curUser.iProfile] then
		local infostring = curUser.sMyInfoString
		if not ( strsub(infostring,strlen(infostring),strlen(infostring)) == "|" ) then
			infostring = infostring.."|"
		end
		local _,_,share = strfind(infostring,"%$(%d+)%$|$")
		if tonumber(share) then
			if tonumber(share) < shareProfiles[curUser.iProfile] then
				curUser:SendData("You haven't met the minimum share of "..shareProfiles[curUser.iProfile].." Gb for your class.") 
				curUser:Disconnect()
			end
		else
			curUser:Disconnect()
		end
	end
end

plop

QuoteOriginally posted by Punkie
Thanks a lot...it works! :-)
Can I ask you for one another help...?

I would like to send to registered user...if he will be disconected...why he is disconected.

Something like:

SendToNick(curUser.sName," You don't met the share minimum x Gb")

If I put it into script...it doesnt work.
I am a beginner :-/.
thats a problem which can happen on the beta's/some clients.
somehow the connection is lost before the text is recieved by the client.
seems 2 happen more on some modded clients.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Punkie

#5
Thanks a lot :-))

SMF spam blocked by CleanTalk