Forum

> > CS2D > Scripts > usebutton for admin
Forums overviewCS2D overview Scripts overviewLog in to reply

English usebutton for admin

6 replies
To the start Previous 1 Next To the start

old usebutton for admin

daris
User Off Offline

Quote
Hello guys i want to create script to only admin can use button to open and close a door but it dosnt work please help me.

1
2
3
4
5
6
addhook("usebutton","adminbutton")
function adminbutton(id, x, y)
    if pl[id].lvl >= 10 then
    parse("trigger A1" ..id.. "67, 102 ")
    end
end

old Re: usebutton for admin

Bowlinghead
User Off Offline

Quote
Is that the whole script or is it the smallest potion of it?
Any error messages in console?
Which doors? All doors? Only some buttons? Who is admin? Why is admin? Does the door open on button press without any scripts?

Wrong usage of parse("trigger A1" ..id.. "67, 102 ")?
cs2d cmd trigger
cs2d cmd triggerposition

No return 1; so script will only work on maps which dont already have that button
cs2d lua hook use
cs2d lua hook usebutton

old Re: usebutton for admin

daris
User Off Offline

Quote
Hey i made adminhouse so i want to open doors with 4 buttons but i dont want everyone can open it, only admins.

67 102, 72 102, 67 104, 72 104
this is tiles of 4 buttons please help me

and there is 4 tiles of doors named A1

old Re: usebutton for admin

The Dark Shadow
User Off Offline

Quote
@user daris: I don't think there is anyone who will write you scripts here, usually most of them only help you with the stuff and give you the main ideas, they don't write all the code for you.

old Re: usebutton for admin

daris
User Off Offline

Quote
where i asked for whole script? i just asked for help beacuse i dont understand how to make this work!

old Re: usebutton for admin

Bowlinghead
User Off Offline

Quote
Is it your map? Can you modify it? Make it, so the buttons dont do anything by the map itself, same for doors. The connection between buttons and doors will happen by the script
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview