English script which will open a quick menu by pressing EE

4 replies
Goto Page
To the start Previous 1 Next To the start
Up
saddy gamer
User
Offline Off
actually I made a jail map and I need a script which will open a quick menu by pressing double E

I need this commands in the quick menu...

for CTS :-
halt
last warning
drop everything
come here
stay there

fot TS :-
sorry
I dont have anything
leave me alone
I need health
please open this

Add some freeslots so I can add some more commands for both of them

And I need a cuff script too which will cuff opponent when he is wearing claw

and the opponent team the (player which had been cuffed can break it after stroking it on the wall much times)

AND ONE LAST SCRIPT An admin script not all facilities only two options 1 ) restart server (only admin can use this)
2) spawn a player after his death (only admin,and mod2 can use this)
and the script must open by F5 OR ABOVE

Actually I am new in this scripting

And I dont have enough RAM and ROM to learn it thanks
edited 1×, last 01.08.18 07:03:17 am
31.07.18 02:05:06 pm
Up
Hi
I have script of hand cuff which my friend gave me.
that script have some bugs and i don't know Lua scripting so i can't fix it.

i can you give that script but you need to fix that code by another person who know lua scripting.

Contact me at Discord ID:
I'mQuiet
FRiendly boYy.
31.07.18 04:08:30 pm
Up
Rainoth
Moderator
Offline Off
Seeing how you can ask, I'll try to help you out. With that said, don't expect people here to make things for you. We can only help you out to figure out what problems the scripts you make have.
The first step is to refer to CS2D help page for scripting.
It's easy to learn lua and how to script in cs2d so I doubt you'll have problems.

For your specific problems, here's what you'll need to do.

For quick menu, you'll need cs2d lua hook use (to check when E is pressed) and cs2d lua hook ms100 to check if the E was pressed quickly enough to open a menu for the player. You'll also probably want to check if the player is standing near Triggerable entities to avoid invoking menu when it shouldn't be invoked.
If that's not the case, you'll use cs2d lua cmd menu based on cs2d lua cmd player 's team.

For cuff system I see another user has already suggested sharing a script he has so if you get any problems with understanding it, share it here and someone will probably point out the problems.

Let me emphasize that you should try to learn how to script if you want lua scripts. We value the effort you put in. Asking for handout won't end well.

Good luck
02.08.18 09:01:23 am
Up
saddy gamer
User
Offline Off
user Man Of Steel has written:
Hi
I have script of hand cuff which my friend gave me.
that script have some bugs and i don't know Lua scripting so i can't fix it.

i can you give that script but you need to fix that code by another person who know lua scripting.

Contact me at Discord ID:
I'mQuiet



give me your discord tag
03.08.18 01:51:05 am
Up
minos
User
Offline Off
try this :
Code:
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
26
27
28
29
delay = {}
addhook("use","use_")
function use_(id, event, data, x, y)
if not entity(x,y,'name') then 
delay[id] = delay[id] + 1 
if delay[id] > 1 then 
delay[id] = 0
 if player(id, "team") == 1 then 
 menu(id,"Orders, sorry,I dont have anything,leave me alone,I need health,please open this")
 elseif player(id,"team")==2 then
 menu(id,"Orders, sorry,I dont have anything,leave me alone,I need health,please open this") -- add ur phrases here
end
end
end
end

addhook("second","second_")
function second_()
for _, id in ipairs(player(0,'tableliving')) do
if delay[id]> 0 then 
delay[id]= delay[id] - 1 
end
end
end

addhook("join","join_")
function join_(id)
delay[id] = 0
end
l
To the start Previous 1 Next To the start