Forum

> > CS2D > Scripts > Making an Admin script?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Making an Admin script?

28 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: Making an Admin script?

Louie
User Off Offline

Zitieren
@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 ×

alt Re: Making an Admin script?

Bowlinghead
User Off Offline

Zitieren
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 hat geschrieben
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?

alt Re: Making an Admin script?

Louie
User Off Offline

Zitieren
@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)

alt Re: Making an Admin script?

Louie
User Off Offline

Zitieren
@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)
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht