Send to Master only...
 

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

Send to Master only...

Started by NemeziS, 31 October, 2004, 01:15:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

Hello!
I'm searching for SendTo   command that will send something only to admin (Master). I don't know how to make it. I know SemdToAll, SendPM,  SendData,  SendPMToOps. I tryed SendPMToMasters, but it didn't work. Can you tell me how to make the script send PM message only to Master (not to Ops) or to selected person? I need it very much!
--LUA forever! =)

Corayzon

this might seem like something easy to add. but its a little more complex then u think.

im not gonna write the script for ya but i can tell ya the process's that need to be done.

First of all u need a table of logged masters to loop through. Next u need to make a function loop through this table, and send a pm to each username found in it.

in presudo code this would be like so...

function SendPmToMasters(sFrom, sMessage)

for sNick, bMaster in tLoggedMasters do

SendPmToNick(sNick, sFrom, sMessage)

end

end

and to save nicks into the table u would use something like...

function OpConnected(tUser)

if tUser.iLevel = 0 then

tLoggedMasters[tUser.sName] = 1

end

end

and ofcourse ull also need to remove the ops from the table ...

function OpDisconnected(tUser)

if tUser.iLevel = 0 then

tLoggedMasters[tUser.sName] = nil

end

end

hope this helps ya dude...

noza

??????Hawk??????

Heya m8  ...

Maby you can make use of this Function. Stripped from  Xsthetic Netservers    Master Chat room  option..



MasterChatName = "Master-Chat"

function MasterChatRoom(user,msg)
      local Masters=GetUsersByProfile("Master") 
   		for i, n in Masters do 
			local usr = GetItemByName(n)
				if  usr ~= nil then
     					if usr.sName ~= user.sName then 
						usr:SendData("$To: "..usr.sName.." From: "..MasterChatName.." $<"..user.sName.."> " ..msg)
  					end 
				end 
		end
end


??????Hawk??????

Corayzon

this scripts steals process that aint needed =[

but im not here to change it :P

noza

??????Hawk??????

hi  Croyzon m8   Thaught you lost ur way here  :P


yeh sure creating a table as they log in is more efficient
 but what happens when they click that Good o'le Restart Scripts Button  ???  

at least that way it would still function..

and yes that function could be optimized further,  im still workin my way through the main script re coding all my 1st generation Mess that i once called Scripting.  lol

anyway  good  to see you back m8  .. :))  :))

??????Hawk??????

Corayzon

if i was writing it myself the table would be saved on every change, and then loaded on Main() ;)

or u could use the above script u posted to rebuild the table ;)

remember server start process dont have to be quick! just the ones that are called lots like searchs and user connections.

noza

SMF spam blocked by CleanTalk