Forum

> > CS2D > Scripts > usebutton for admin
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch usebutton for admin

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt usebutton for admin

daris
User Off Offline

Zitieren
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

alt Re: usebutton for admin

Bowlinghead
User Off Offline

Zitieren
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

alt Re: usebutton for admin

daris
User Off Offline

Zitieren
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

alt Re: usebutton for admin

The Dark Shadow
User Off Offline

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

alt Re: usebutton for admin

daris
User Off Offline

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

alt Re: usebutton for admin

Bowlinghead
User Off Offline

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