PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: lito on 17 March, 2007, 11:40:36

Title: Op-Blocker 1.0 LUA 5.0/5.1
Post by: lito on 17 March, 2007, 11:40:36
is it possible to changes this script so you can allow some profiles to download from ops

--[[

   Op-Blocker 1.0 LUA 5.0/5.1

   by Mutor        04/09/06
   
   Requested by Braum

   Blocks file transfers from op by non-ops.
]]

ConnectToMeArrival = function(user, data)
   local s,e,op = string.find(data,"^$ConnectToMe%s(%S+)")
   if not op then
      local s,e,op = string.find(data,"^$RevConnectToMe%s%S+%s(%S+)|$")
   end
   if op and GetProfilePermissions(GetUserProfile(op))["bIsOP"] == 1 then
      if not user.bOperator then
              user:SendData(GetProfileName(user.iProfile).."'s may not download from "..
         "an operator. Please clear the transfer from "..op.." your download queue.")
         return 1
      end
   end
end
RevConnectToMeArrival = ConnectToMeArrival

Lito :)
Title: Re: Op-Blocker 1.0 LUA 5.0/5.1
Post by: 6Marilyn6Manson6 on 17 March, 2007, 12:09:26
--[[

   Op-Blocker 1.0 LUA 5.0/5.1

   by Mutor        04/09/06
   
   Requested by Braum

   Blocks file transfers from op by non-ops.
]]
-- Modded by 6Marilyn6Manson6, requested by lito 17/03/2007
-- Not Tested
------------------------------------------------------
BlockProfiles={ -- 0 = Not Allow Download From OPs / 1 = Allow Download From OPs
[0]=1,  -- Profile #0 (Registered)
[1]=1,  -- Profile #1 (VIP)
[2]=0,  -- Profile #2 (Operator)
[3]=0,  -- Profile #3 (Moderator)
[4]=0,  -- Profile #4 (Master)
[5]=0,  -- Profile #5 (Netfounder)
[-1]=1, -- Profile #-1 (Unregistered)
}
------------------------------------------------------
------------------------------------------------------
ConnectToMeArrival = function(user, data)
   local s,e,op = string.find(data,"^$ConnectToMe%s(%S+)")
   if not op then
      local s,e,op = string.find(data,"^$RevConnectToMe%s%S+%s(%S+)|$")
   end
   if op and GetProfilePermissions(GetUserProfile(op))["bIsOP"] == 1 then
      if BlockProfiles[user.iProfile] == 1 then
              user:SendData(GetProfileName(user.iProfile).."'s may not download from "..
         "an operator. Please clear the transfer from "..op.." your download queue.")
         return 1
      end
   end
end
RevConnectToMeArrival = ConnectToMeArrival
------------------------------------------------------
--// 6Marilyn6Manson6


Try this version
Title: Re: Op-Blocker 1.0 LUA 5.0/5.1
Post by: lito on 17 March, 2007, 12:18:31
thanks 6Marilyn6Manson6 it works fin

Lit ;D
Title: Re: Op-Blocker 1.0 LUA 5.0/5.1
Post by: 6Marilyn6Manson6 on 17 March, 2007, 14:10:02
 ;)