Forum

> > CS2D > Scripts > Making an Admin script?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Making an Admin script?

28 replies
Page
To the start Previous 1 2 Next To the start

old Re: Making an Admin script?

Louie
User Off Offline

Quote
@user Bowlinghead: i did i just didn't want to show the "ends" because its a bit long
but heres the full 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
addhook("say","kicksay")
function kicksay(id,text)
for none, usgn in ipairs(ADMIN) do
if player(id,'usgn') == usgn then
  if text:sub(1, 5) == "!kick" then --KICK
     kickid = text:sub(6, 7)
     kickreason = text:sub(8)
    parse("kick "..kickid.." "..kickreason)
return 1
elseif text:sub(1, 6) == "!banip" then --BanIp
     banipp = text:sub(7, 18)
     bantime = text:sub(19, 22)
     banreason = text:sub(23)
    parse("banip "..banipp.." "..bantime.." "..banreason)
return 1
elseif text:sub(1, 8) == "!banusgn" then --Ban USGN id
     banusgnid = text:sub(1, 6)
     bantime = text:sub(19, 22)
     banreason = text:sub(23)
    parse("banusgn "..banusgnid.." "..bantime.." "..banreason)
return 1
elseif text:sub(1, 5) == "!kill" then --Kill a player
     killid = text:sub(6, 7)
    parse("killplayer "..killid)
return 1
elseif text:sub(1, 5) == "!mute" then --Mute a player
     mutep = text:sub(6, 7)
  mute[id] = 1 
end
end
end
end
end
though its not fully finished but it works(kick,ban,kill)
example:
I type in !kick 5,player with that id gets kicked(it works) √
but it shows the !kick 5 message in the chat area ×

old Re: Making an Admin script?

Bowlinghead
User Off Offline

Quote
You made too much ends which is easy to spot if you tab your code.
example >

The last "end" has to be deleted.


cs2d lua hook say
cs2d.com has written
Return Values
0: proceed normally
1: don't show message


If it is still showing the message then I have no idea why...
Does the console show errors?

old Re: Making an Admin script?

Louie
User Off Offline

Quote
@user Bowlinghead: Nope,it doesn't show any errors in the console,its really weird that it still shows the message.Well at least its working properly(kicking,ban or kill)

old Re: Making an Admin script?

Louie
User Off Offline

Quote
@user Bowlinghead: No its not lacking or needing another "end" well its just a minor problem now for me at least when i say !kick 2 it will kick a player(or when i say !ban or !slap)
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview