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.
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
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 :-/.
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
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
Thanks a lot :-))