Forum

> > CS2D > Scripts > Open menu by command
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Open menu by command

30 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Open menu by command

Marcell
Super User Off Offline

Zitieren
Welcome!

I'would like to know how can i do that when i type !menu to chat that open a menu
like that i wanna use Engineer's Doctor Who script on my pc, but i use admin script already.. how can i change it to not open by serveraction buttons, otherwise open it by say like !tardis

alt Re: Open menu by command

Mora
User Off Offline

Zitieren
mm i have one,maybe it?:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("say","said")
addhook("menu","m")

function said(id,text)
     if text=="!menu" then
menu(id,"Test Menu,Equip M4A1,Machete,Snowballs")
     end
end

function m(id,title,b)
     if title=="Test Menu" then
 if b==1 then
parse("equip "..id.." 32")
 elseif b==2 then
parse("equip "..id.." 69")
 elseif b==3 then
parse("equip "..id.." 75")
     end
 end
end

alt Re: Open menu by command

Varna97
User Off Offline

Zitieren
user Mora hat geschrieben
mm i have one,maybe it?:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("say","said")
addhook("menu","m")

function said(id,text)
     if text=="!menu" then
menu(id,"Test Menu,Equip M4A1,Machete,Snowballs")
     end
end

function m(id,title,b)
     if title=="Test Menu" then
 if b==1 then
parse("equip "..id.." 32")
 elseif b==2 then
parse("equip "..id.." 69")
 elseif b==3 then
parse("equip "..id.." 75")
     end
 end
end


Wrong ×

function m(id)
if title=="Weapons" then
if b==1 then
parse("equip "..id.." 32")
elseif b==2 then
parse("equip "..id.." 69")
elseif b==3 then
parse("equip "..id.." 75")
end
end

alt Re: Open menu by command

Mora
User Off Offline

Zitieren
@user Varna97: you test my code?yes/not?what your skills with scripts?
CS Varna d-_-b hat geschrieben
function m(id)
if title=="Weapons" then
if b==1 then
parse("equip "..id.." 32")
elseif b==2 then
parse("equip "..id.." 69")
elseif b==3 then
parse("equip "..id.." 75")
end
end

here you will got error:
"Lua error: "end" it is expected near "if" at line 2"

@user Marcell: tell me if my work,please...
1× editiert, zuletzt 05.01.14 13:34:36

alt Re: Open menu by command

Rainoth
Moderator Off Offline

Zitieren
Mehr >


BOBA Pycckuu : 1
Hacker : 0

He gave a normal script. Well... It could be tabbed but it's just reading it, it's executed properly anyway.

// How is he not banned yet ? It's so obvious that he's a hacker >.>

alt Re: Open menu by command

Rainoth
Moderator Off Offline

Zitieren
Duhh. And it's not just "Sonic Black Knight". There's many variations of that account and they all have same facebook in them. I've already reported a lot of them but he keeps creating more accounts. I've told about it to DC and he banned most of them but here's a new one... I've been refering to him as a hacker for about two-three months but nobody cares so..

// I know that he's a hacker because he used to come to my server and hack there heh. Too bad there's no such thing as reporting in-game. Well I guess a 2D indie game doesn't need so much attention so it's all good.

alt Re: Open menu by command

Mora
User Off Offline

Zitieren
Lol,kid try scripts...failed
try multi account...failed
try hack on servers...failed
try crush servers...failed

alt Re: Open menu by command

Marcell
Super User Off Offline

Zitieren
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
usgn = {
r8 = {6943}; 	  -- AdminController(s)
r7 = {};          -- SuperAdmin(s)
r5 = {};          -- Admin 5 
r4 = {};          -- Admin 4
r3 = {};          -- Admin 3
r2 = {};          -- Admin 2
r1 = {};          -- Admin 1
rH = {};          -- Admin Helper(s)
rVip = {};		  -- VIP User(s)
}

function table.contains(table, element)
    for key, value in pairs(table) do
        if value == element then
            return true
        end
    end
end

	if table.contains(usgn.r8,player(id,"usgn")) then
		if team = 2 then
		return 0;
		else
		parse("maket " .. id);
		return 0;
	end
	end

wont work

alt Re: Open menu by command

Marcell
Super User Off Offline

Zitieren
not work

1
2
3
4
5
6
7
8
9
10
if table.contains(usgn.r8,player(id,"usgn")) then
		if team = 2 then
		return 0;
		else
		if team == 2 then
		parse("maket " .. id);
		return 0;
	end
	end
end

alt Re: Open menu by command

Gajos
BANNED Off Offline

Zitieren
user Marcell hat geschrieben
not work

1
2
3
4
5
6
7
8
9
10
if table.contains(usgn.r8,player(id,"usgn")) then
		if team = 2 then
		return 0;
		else
		if team == 2 then
		parse("maket " .. id);
		return 0;
	end
	end
end

You are st*pid.

alt Re: Open menu by command

Mora
User Off Offline

Zitieren
@user Gajos: you`re snapper
@user Marcell: maybe @user Gajos: mean it:
if table.contains(usgn.r8,player(id,"usgn")) then
if team == 2 then
return 0;
else
parse("maket "..id);
return 0;
end
end
1× editiert, zuletzt 06.01.14 04:58:33

alt Re: Open menu by command

Marcell
Super User Off Offline

Zitieren
Not really works..

If i logged in i able to join to CT team
but if i logged out already able to join to CT...

alt Re: Open menu by command

sheeL
User Off Offline

Zitieren
You are searching for 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
26
27
28
29
30
31
32
33
addhook("team","check_me")

USGN = {
	r8 = {6943,45813};        -- AdminController(s)
	r7 = {};          -- SuperAdmin(s)
	r5 = {};          -- Admin 5 
	r4 = {};          -- Admin 4
	r3 = {};          -- Admin 3
	r2 = {};          -- Admin 2
	r1 = {};          -- Admin 1
	rH = {};          -- Admin Helper(s)
	rVip = {};            -- VIP User(s)
}

function table.contains(table, element)
    for key, value in pairs(table) do
        if value == element then
            return true
        end
    end
end

function check_me(id,team)
local USGN_id = player(id,"usgn")
	if (team==2) then
		if table.contains(USGN.r8,USGN_id) then
		return 0
	else
		parse("maket "..id);
		return 1
		end
	end
end

alt Re: Open menu by command

Marcell
Super User Off Offline

Zitieren
why you thinkin' i will add to Admin Controller team? Maybe you helped in this script, but i will not add to for it man

Anyway still able to join to CT lol

alt Re: Open menu by command

Mora
User Off Offline

Zitieren
admin = {6943,114940}

addhook("join","j")
function j(id,team)
for _, usgn in ipairs(admin) do
if player(id,"usgn")==usgn then
if team==2 then
return 1
else
parse("maket "..id)
end
end
end
end

LOL,f***g my code.

alt Re: Open menu by command

Rainoth
Moderator Off Offline

Zitieren
user Marcell hat geschrieben
Anyway still able to join to CT lol


That moment when you realize how much you've failed.
Of course you'd be able to be a CT. You're included in the table --"
I just tested Sheel's code. It's working fine.

alt Re: Open menu by command

Marcell
Super User Off Offline

Zitieren
not work with my whole script. i tested with just this one script and it worked, but with all somewhy not

alt Re: Open menu by command

Rainoth
Moderator Off Offline

Zitieren
I'm afraid your reply is useless. Saying "It doesn't work" won't help us in any way to solve your problem. If it works alone but not together, you might have multiple hooks/variables, maybe wrong calls. We can only suspect/assume if you don't provide us anything.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht