PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Zigurds on 22 July, 2005, 18:58:18

Title: Userchat (Vipchat)
Post by: Zigurds on 22 July, 2005, 18:58:18
For this script need descriptions

---------------------------------------------------------------------------------------------------------------------
--   PRIVATCHATS
---------------------------------------------------------------------------------------------------------------------
--// Simple PrivatChat by NightLitch 2005-03-05

PrivatChatName = "-USERCHATS-"

function Main()
   frmHub:RegBot(PrivatChatName)
end


function ToArrival(user,data)
   local s,e,to,from,msg = string.find(data,"%$To:%s+(%S+)%s+From:%s+(%S+)%s+%$%b<>%s+(.*)%|")
   if to == PrivatChatName then
      if user.iProfile == -1 or user.iProfile == 2 or user.iProfile == 3 then
         PrivatChat(user,msg)
      else
         SendPmToNick(user.sName,PrivatChatName, "*** Atvaino, bet tev nav tiesiibu sheit rakstiit!")
         return 1
      end
   end
end

function PrivatChat(user,msg)
   for _,profile in GetProfiles() do
      for _,users in GetUsersByProfile(profile) do
         if GetItemByName(users) then
            if GetItemByName(users).iProfile == -1  or user.iProfile == 2 or user.iProfile == 3 then
               if GetItemByName(users).sName ~= user.sName then
                  GetItemByName(users):SendData("$To: "..GetItemByName(users).sName.." From: "..PrivatChatName.." $<"..user.sName.."> "..msg)
               end
            end
         end
      end
   end
end

------------------------------------------------------------------------------------------------------------------

owner for Latvian hub ALFA
http://www.hub.lv
Title:
Post by: Zigurds on 22 July, 2005, 19:50:14
tb, name any (userchat, vipchat)  and free forms descriptions

--------------------------------
owner for Latvian hub ALFA
http://www.hub.lv