Forum

> > CS2D > Scripts > Serveraction hook pr0blem.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Serveraction hook pr0blem.

7 replies
To the start Previous 1 Next To the start

old Serveraction hook pr0blem.

Yates
Reviewer Off Offline

Quote
Note: I wasn't allowed to use problem. And I'm lazy and an ass so I wrote pr0blem. So, DC. If you're reading this. Don't delete my thread, it's all your "No problem" in title fault.

Right, Danny made a script, and gave me a function so I could use it on mine (Everything works, except when I try to use this);

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
lvl = checkLevel(player(id,"usgn"))
	if lvl >= 3 then

-- I put it in this;

addhook("serveraction","wall")
function wall(id,act)
lvl = checkLevel(player(id,"usgn"))
	if lvl >= 3 then
		if act == 2 then
			menu(id,"Admin menu,Server settings,Spawn building,Spawn NPC,Gear,Extra")
		elseif act==3 then
			if wallhack[id] == 1 then
				msg2(id,"©181181181<Wallhack off>")
				wallhack[id] = 0
			elseif wallhack[id] == 0 then
				msg2(id,"©181181181<Wallhack on>")
				wallhack[id] = 1
			end
		end
	end
	if act==1 then
		menu(id,"Player menu,Buy menu,Drop money,More")
	end
end
And it doesn't work. No errors in the console.., Danny says it should work, but cs2d is being an asshole.

Any idea's?
edited 1×, last 09.11.11 05:56:30 pm

old Re: Serveraction hook pr0blem.

Yates
Reviewer Off Offline

Quote
Act==1 works.

checkLevel function;
1
2
3
4
5
6
7
8
9
10
11
12
function checkLevel(id)
 local usgn = player(id,"usgn")
 if ( tableFind(super_admins,usgn) ~= false ) then
  return 4
 elseif ( tableFind(admins,usgn) ~= false ) then
  return 3
 elseif ( tableFind(vip,usgn) ~= false ) then
  return 2
 else
  return 1
 end
end

old Re: Serveraction hook pr0blem.

DannyDeth
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
function checkLevel(id)
	local usgn = player(id,"usgn")
	if ( tableFind(super_admins,usgn) ~= false ) then
		return 4
	elseif ( tableFind(admins,usgn) ~= false ) then
		return 3
	elseif ( tableFind(vip,usgn) ~= false ) then
		return 2
	else
		return 1
	end
end

EDIT: naughty ninja.

old Re: Serveraction hook pr0blem.

Yasday
User Off Offline

Quote
user DannyDeth has written
That still won't change the fact that CS2D isn't hooking the function, Yasday.

user Yates has written
Act==1 works.

It is hooking the function.

user Yates has written
I changed it to;

1
checkLevel(id)

Works.


That's what I meant.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview