Forum

> > CS2D > Scripts > Again bugs in script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Again bugs in script

6 replies
To the start Previous 1 Next To the start

old Again bugs in script

Crash13
User Off Offline

Quote
Again with my prroblems. I am starter scripter, and i need some help please. Now i make a script for DEATHRUN servers. Console don't find bugs, but when i press F2 -> Admin Menu then says me: You are not authorized to enter in this menu!

Why says to me? I am admin, need to say for all players (that is not on admin list.) I made a test: enter in my server with this script, and i closed usgn, then press F2 -> Admin Menu, Menu don't appear (this work) but message aren't.

Instead to show message to them, says to me, but menu work only for admin list.

Spoiler >


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Admins = {33373}

addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
	if button == 2 then
	parse("equip "..id.." 34")
		elseif button == 3 then	
			for _, usgn in ipairs(Admins) do
				if player(id,"usgn") == usgn then
				menu(id,"Admin Menu,Kick,Ban")
					if player(id, 'usgn')>=1 then
						msg2(id,"©255000000You are not autorized to enter in this menu!@C")
					end		
				end	
			end
		end
	end
end
edited 1×, last 12.01.12 05:17:04 pm

old Re: Again bugs in script

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
	if button == 2 then
		parse("equip "..id.." 34")
	elseif button == 3 then	
		for _, usgn in ipairs(Admins) do
			if player(id,"usgn") == usgn then
				menu(id,"Admin Menu,Kick,Ban")
			elseif player(id, 'usgn')>=1 then
				msg2(id,"©255000000You are not autorized to enter in this menu!@C")
			end		
		end	
	end
end

old Re: Again bugs in script

Crash13
User Off Offline

Quote
user Alistaire has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
	if button == 2 then
		parse("equip "..id.." 34")
	elseif button == 3 then	
		for _, usgn in ipairs(Admins) do
			if player(id,"usgn") == usgn then
				menu(id,"Admin Menu,Kick,Ban")
			elseif player(id, 'usgn')>=1 then
				msg2(id,"©255000000You are not autorized to enter in this menu!@C")
			end		
		end	
	end
end


Thanks. But message don't appear in general (and admins, and simpler players).

old Re: Again bugs in script

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
	if button == 2 then
		parse(equip "..id.." 34)
	elseif button == 3 then	
		if player(id,"usgn") == 33373 then
			menu(id,"Admin Menu,Kick,Ban")
		else
			msg2(id,"©255000000You are not autorized to enter in this menu!@C")	
		end	
	end
end

Why the fuck did you copy like 80% of this script from other scripts.

old Re: Again bugs in script

Crash13
User Off Offline

Quote
@user Alistaire: hmm.... thanks. And this is not copied from cs2d, or unreal scripts, i saw this script in cs 1.6, now i make that script in cs2d, and i make single

old Re: Again bugs in script

EngiN33R
Moderator Off Offline

Quote
user Alistaire has written
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
	if button == 2 then
		parse(equip "..id.." 34)
	elseif button == 3 then	
		if player(id,"usgn") == 33373 then
			menu(id,"Admin Menu,Kick,Ban")
		else
			msg2(id,"©255000000You are not autorized to enter in this menu!@C")	
		end	
	end
end


You missed one end in the end.

old Re: Again bugs in script

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("menu","deathmen")
function deathmen(id,title,button)	
	if title == "DEATHRUN Menu" then
		if button == 2 then
			parse(equip "..id.." 34)
		elseif button == 3 then	
			if player(id,"usgn") == 33373 then
				menu(id,"Admin Menu,Kick,Ban")
			else
				msg2(id,"©255000000You are not autorized to enter in this menu!@C")	
			end	
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview