Forum

> > CS2D > Scripts > Button press
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Button press

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Button press

Suprise
BANNED Off Offline

Zitieren
When you press Button(serveraction 3) then a menu:(
1
menu(id,"Select map,bla,bla,bla,bla")
) activated and player never can press it again. And nobody can press it again.

So:
Player1 pressed F4 . He voted for the map. He and all players never can press F4 again. (They can but doesnt do anything)

( I hope you understand me ! )
Thx in advance !

alt Re: Button press

Avo
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
pressed=false
addhook("serveraction","_action")
function _action(id,a)
	if pressed==false and a==3 then
		pressed=true
		--your code here
	end
end

alt Re: Button press

Cons
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("serveraction","vote")
function vote(id,act)
if act==3 then
menu(id,"Vote For Map,Map1,Map2,Map3,Map4")
end
end

addhook("menu","nowthemenu")
function nowthemenu(id,title,buton)
if title=="Vote" then
if buton==1 then
msg("©255255255"..player(id,"name").." Voted For Map1")
freehook("serveraction","vote")
end
end
end

Mehr >

alt Re: Button press

Suprise
BANNED Off Offline

Zitieren
both working fine. Thank you for helping

EDIT: Can you edit it that map will change to 'map1' at the endround?

EDIT2: I did that.

EDIT3: Heey. This works only whit the first button. second and third doesnt work (Dresa's)
Nvm Bolt_PL your code is work perfectly.
2× editiert, zuletzt 15.05.12 19:32:09

alt Re: Button press

Cons
User Off Offline

Zitieren
user Suprise hat geschrieben
EDIT3: Heey. This works only whit the first button. second and third doesnt work (Dresa's)


Doesnt work?

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
addhook("serveraction","vote")
function vote(id,act)
if act==3 then
menu(id,"Vote For Map,Map1,Map2,Map3,Map4")
end
end

addhook("menu","nowthemenu")
function nowthemenu(id,title,buton)
if title=="Vote For Map" then
if buton==1 then
msg("©255255255"..player(id,"name").." Voted For Map1")
freehook("serveraction","vote")
elseif buton==2 then
msg("©255255255"..player(id,"name").." Voted For Map2")
freehook("serveraction","vote")
elseif buton==3 then
msg("©255255255"..player(id,"name").." Voted For Map3")
freehook("serveraction","vote")
elseif buton==4 then
msg("©255255255"..player(id,"name").." Voted For Map4")
freehook("serveraction","vote")
end
end
end

Are you Sure?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht