Forum

> > CS2D > Scripts > Temp Mod Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Temp Mod Script

16 replies
To the start Previous 1 Next To the start

old Temp Mod Script

_NONSTOP
User Off Offline

Quote
Hi, im looking for a script that it's about making a player mod with a command, example: mod 2, and the player will be a moderator, when the player left, the moderator status will be removed and when he joins again he can not use command or tag.

Thanks for reading, and hope you help me.

old Re: Temp Mod Script

VADemon
User Off Offline

Quote
user Mami Tomoe no, as far as I know all admin scripts give permanent permissions to players.

@user _NONSTOP: I have an idea though. Most scripts have a single function to save the stats/moderator groups. If you manage to edit this function, this might result in temporary permissions because the script won't save/load the stats for newer users (after you setup the permanent access for yourself)

old Re: Temp Mod Script

_NONSTOP
User Off Offline

Quote
Temporary im using TopNotch Administration Script, But, here on us.de isn't a command to put a Single Player as a Temp. Moderator. As the command what i said: ''mod 2''. Then i wanna put the command on TN Admin Script.
edited 1×, last 16.08.15 11:13:01 pm

old Re: Temp Mod Script

G3tWr3ck3d
User Off Offline

Quote
you can make smt like:

1
2
3
4
5
6
7
8
9
10
11
function _say(id,txt)
if level[id] == 5 then -- The admin or whatever rank
if txt == "!make" then
level[pl] = 4 -- Mod rank or whatever


function _leave(id)
if level[id] > 0 then
level[id] = 0 -- You just add this part wich will remove the id level
end
end
edited 3×, last 17.08.15 01:54:34 am

Admin/mod comment

Code tag added for this piece of code! /user GeoB99

old Re: Temp Mod Script

The Gajos
BANNED Off Offline

Quote
• Isn't tested!
• propably it could work that when you type '!makemod <id>', he will get mod

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
-----------------------------------------
-- Small Command Processor for MixTape --
--     Copyrights (c) Adrian Gajos     --
-----------------------------------------
command = {
     ['makemod'] = {
          alivePlayer = false;
          reUse = 5;
          action = function(id,pl)
               local pl = tonumber(pl)
			if pl then
				rank[id] = 1
			end
          end;
     };
}
reUse = {}

function chatInput(id,txt)
     if validCommand(txt) then
		local TXT = txt
          local txt = string.lower(txt)
          local words = toTable(txt)
          local cmd = words[1]:sub(2)
          local args = words
          table.remove(args,1)
          
          if isCommand(cmd) then
               local Return = true
               if command[cmd].alivePlayer then
                    if player(id,'health') <= 0 then
                         Return = false
                    end
               end
               if Return then
                    reUse[id] = reUse[id] or {}
                    reUse[id][cmd] = reUse[id][cmd] or 0
                    if os.time() - command[cmd].reUse >= reUse[id][cmd] then
                         command[cmd].action(id,unpack(args))
                         reUse[id][cmd] = os.time()
                    end
               else
                    msg2(id,'\169255050000You cannot use this command while you are dead')
               end
          else
               msg2(id,'\169255050000Unknown command '..string.char(39)..cmd..string.char(39))
          end
          return 1
	else
		if rank[id] == 1 then
			msg('\169001223001'..player(id,'name')..'[MOD]: \169255220000'..TXT)
			return 1
		end
     end
end
addhook('say','chatInput')

function validCommand(txt)
     if (txt:sub(1,1) == '@' or txt:sub(1,1) == '!') and txt ~= 'rank' then
          return true
     end
     return false
end

function isCommand(cmd)
     for i in pairs(command) do
          if i == cmd then
               return true
          end
     end
     return false
end

function toTable(txt,match)
     local cmd = {}
     if not match then match = '[^%s]+' end
     for word in string.gmatch(txt,match) do
          table.insert(cmd,word)
     end
     return cmd
end

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

rank = {}
function onJoin(id)
	rank[id] = 0
end
addhook('join','onJoin')

old Re: Temp Mod Script

G3tWr3ck3d
User Off Offline

Quote
Oh wow dude, you only removed the rank on join? What if he joins and you will remove his rank too? Besides he is using TN admin and that script doesnt even have tables like rank. He wont understand shit from that

old Re: Temp Mod Script

VADemon
User Off Offline

Quote
user _NONSTOP here you go, I didn't test it though.
Command: !tempmod <ID>
It's only available to admins
The Code; use the "Quote this message" button to keep the tabbed code >

old Re: Temp Mod Script

_NONSTOP
User Off Offline

Quote
Then, how can i make a equip function to the player who is tempmod?.
edited 3×, last 17.08.15 07:25:21 pm

old Re: Temp Mod Script

VADemon
User Off Offline

Quote
Don't edit your messages like that. Add the new reply to your previous post.

What do you mean by equip function?

old Re: Temp Mod Script

_NONSTOP
User Off Offline

Quote
Example: As you command: !tempmod <id> and when the player is a Mod, and when respawn he will got equipped A medic,Deagle, Etc.. But just for the moderator.
But isn't a command.

old Re: Temp Mod Script

VADemon
User Off Offline

Quote
cs2d lua hook spawn
Add it somewhere in the code or make it load after the TN Admin Script
1
2
3
4
5
6
7
addhook("spawn", "TN_spawnEquip")

function spawn(id)
	if pl[id].lvl == 5 then 	-- if equals 5 then Moderator only | if it's more OR equals 5 then it's mods, gamemasters and admins
		return "82"	-- read http://www.cs2d.com/help.php?hook=spawn#hook
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview