Forum

> > CS2D > Scripts > Admin Mode on off
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Admin Mode on off

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Admin Mode on off

limonata
User Off Offline

Zitieren
Hello there i tried to make an admin mode lua but it doesnt work idk here is the lua

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
adm = {50998}

ps = 0


addhook("join","yet")
function yet(id)
		ps = 0
	end

addhook("say","asd")
function asd(id,txt)
	for _, a in pairs (adm) do
		if player(id,"usgn") == a then
			if ps == 1 then
				if txt == "!hi" then
				msg("Test lua")
					if ps == 1 then
				menu(id,"Admin,Admin|On")
						elseif ps ~= 1 then
				menu(id,"Admin,Admin|Off")
					end
				end
			end
		end
	end
end

addhook("serveraction","asd")
function asd(id,act)
	for _, a in pairs (adm) do
		if player(id,"usgn") == a then
			if act == 1 then
			menu(id,"Admin,Admin|Off")
			end
		end
	end
end

addhook("menu","a")
function a(id,tit,but)
	if tit == "Admin" then
		if but == 1 then
		ps = 1
			elseif but == 1 and ps == 1 then
		ps = 0
		end
	end
end
1× editiert, zuletzt 09.03.13 19:41:35

alt Re: Admin Mode on off

cortz
Super User Off Offline

Zitieren
you didnt initialize 'but'
ps is a global value, you should assign it to individual players instead.

and i dont think you need 'exists' in the join hook.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht