usebutton for admin
6 replies



03.07.21 11:30:00 am
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.
Code:
1
2
3
4
5
6
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
function adminbutton(id, x, y)
if pl[id].lvl >= 10 then
parse("trigger A1" ..id.. "67, 102 ")
end
end
Zdravo ja sam caki drago mi je...
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 ")?
trigger
triggerposition
No return 1; so script will only work on maps which dont already have that button
use
usebutton
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 ")?


No return 1; so script will only work on maps which dont already have that button


Share time limited free games here

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
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
Zdravo ja sam caki drago mi je...
@
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.

where i asked for whole script? i just asked for help beacuse i dont understand how to make this work!
Zdravo ja sam caki drago mi je...
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
Share time limited free games here

ye its my map, i do it already i just put name for doors to trigger them
Zdravo ja sam caki drago mi je...



