English Temp Mod Script

16 replies
Goto Page
To the start Previous 1 Next To the start
16.08.15 08:14:19 pm
Up
_NONSTOP
User
Offline Off
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.
Violin Hater
16.08.15 08:25:53 pm
Up
Mami Tomoe
User
Offline Off
Use the search engine I bet there's a lot of these scripts.
Look at me standing, here on my own again
16.08.15 09:05:02 pm
Up
VADemon
User
Offline Off
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)
16.08.15 09:20:38 pm
Up
The Gajos
BANNED
Offline Off
file cs2d [ADMN, DEV] Permissions - WIP (13)
but this guy won't know how to use
16.08.15 10:42:09 pm
Up
_NONSTOP
User
Offline Off
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
Violin Hater
17.08.15 01:36:22 am
Up
G3tWr3ck3d
User
Offline Off
you can make smt like:

Code:
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
Mess with the best, die like the rest. ༼ つ ◕_◕ ༽つ

Admin/mod comment:

Code tag added for this piece of code! /user GeoB99
17.08.15 02:36:53 am
Up
_NONSTOP
User
Offline Off
@Lecram I tested it and nothing's happened
Violin Hater
17.08.15 10:31:51 am
Up
The Gajos
BANNED
Offline Off
• Isn't tested!
• propably it could work that when you type '!makemod <id>', he will get mod

Code:
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')
17.08.15 10:39:13 am
Up
G3tWr3ck3d
User
Offline Off
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
Mess with the best, die like the rest. ༼ つ ◕_◕ ༽つ
17.08.15 11:13:12 am
Up
The Gajos
BANNED
Offline Off
@user G3tWr3ck3d: I don't wanna work for free . Aren't you? I don't care about TN admin. Btw. in my code anyone can use this command :v
user The Gajos has written:
file cs2d [ADMN, DEV] Permissions - WIP (13)
but this guy won't know how to use
17.08.15 11:35:58 am
Up
G3tWr3ck3d
User
Offline Off
Well I rather edit my admin code instead of TN admin. Just saying...
Mess with the best, die like the rest. ༼ つ ◕_◕ ༽つ
17.08.15 01:46:16 pm
Up
VADemon
User
Offline Off
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 >
17.08.15 02:42:58 pm
Up
_NONSTOP
User
Offline Off
Then, how can i make a equip function to the player who is tempmod?.
edited 3×, last 17.08.15 07:25:21 pm
Violin Hater
17.08.15 07:33:15 pm
Up
VADemon
User
Offline Off
Don't edit your messages like that. Add the new reply to your previous post.

What do you mean by equip function?
17.08.15 08:08:14 pm
Up
_NONSTOP
User
Offline Off
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.
Violin Hater
17.08.15 08:39:01 pm
Up
VADemon
User
Offline Off
cs2d lua hook spawn
Add it somewhere in the code or make it load after the TN Admin Script
Code:
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
17.08.15 08:52:05 pm
Up
_NONSTOP
User
Offline Off
user VADemon: Thanks you very much bro. You helped me a lot.
Violin Hater
To the start Previous 1 Next To the start