How to make protection table to scripts??
 

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

How to make protection table to scripts??

Started by ??']['??l?, 23 August, 2006, 12:31:13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

??']['??l?

How can i add protection to lua 5.0x scripts like in robocop exe...
That you can choose which profile is allowed to use command to another profile!

for example netfounder is allowed to mute master..
but when master tries to mute netfounder, then that user gets message: You are not allowed to use this command to netfounders... or
                                                                                                   This user is too powerful to be (command you tried to use)

And it would be even better if that command would come back to that user who tried use it to higher or protected profile... :D :D :D

bastya_elvtars

If you have coding intent, check the LawMaker source code which has this kind of protection built-in (for instance the kickban plugin uses it a lot).
Everything could have been anything else and it would have just as much meaning.

bINKbINK

have a look at FunnyChat script either
it has just the same protection system you're looking for ;) (view Settings.txt, for example)
you can choose who can mute or kennylize as well as who will be affected by the script and who not. of course with the notify as you described

Cêñoßy†ê

small example  ;D

Code: lua
Command["kick"] = function(user,data,where)
	local s,e,Name,rsn = string.find(data, "%b<>%s+%S+%s+(%S+)%s*(.*)")
	if (rsn==nil or rsn == "") then rsn = "No reason given!" end
		local victim = GetItemByName(Name)
		if victim ~= nil then
			if ProtectionTable[user.iProfile][victim.iProfile] == 0 then
				user:SendData(Settings["Script"]["BotName"],"You silly mortal... you cant kick ["..ProfileName(victim.iProfile).."] with that profile!!!")
			else
				if KickTable[victim.sName] == 3-1 then
					victim:SendData(Settings["Script"]["BotName"],"*** You are Permanently banned because: 3x Kicked !")
					SendMessage("*** User "..victim.sName.." Banned because: 3x kicked !",SendWhere)
					victim:Ban()
					victim:NickBan()
					victim:Disconnect()
					KickTable[victim.sName]= nil
				else
					victim:SendPM(Settings["Script"]["BotName"],ProfileName(user.iProfile).." "..user.sName.." just kicked your silly ass Because: "..rsn)
					SendMessage("*** "..victim.sName.." from "..victim.sIP.." got Kicked in the ass by "..ProfileName(user.iProfile).." "..user.sName.." Because: "..rsn,SendWhere)
					UpdateBad(victim,KickTable)
					victim:TimeBan(5) 
					victim:Disconnect()
					end end end return 1 end


ProtectionTable = {
[0] = {
	[0] = 1,
	[1] = 1,
	[2] = 1,
	[3] = 1,
	[4] = 1,
	[5] = 1,
	[6] = 0,
	[-1] = 1,
},
[1] = {
	[0] = 0,
	[1] = 0,
	[2] = 1,
	[3] = 1,
	[4] = 0,
	[5] = 0,
	[6] = 0,
	[-1] = 1,
},
[2] = {
	[0] = 0,
	[1] = 0,
	[2] = 0,
	[3] = 0,
	[4] = 0,
	[5] = 0,
	[6] = 0,
	[-1] = 0,
},
[3] = {
	[0] = 0,
	[1] = 0,
	[2] = 0,
	[3] = 0,
	[4] = 0,
	[5] = 0,
	[6] = 0,
	[-1] = 0,
},
[-1] = {
	[0] = 0,
	[1] = 0,
	[2] = 0,
	[3] = 0,
	[4] = 0,
	[5] = 0,
	[-1] = 0,
},
}
Powered By Leviathan™ 2nd Generation v. 1.9

SMF spam blocked by CleanTalk