Forum

> > CS2D > Scripts > double twice
Forums overviewCS2D overview Scripts overviewLog in to reply

English double twice

8 replies
To the start Previous 1 Next To the start

old double twice

lennon
User Off Offline

Quote
Well i tried to make script but u know me im tottaly brainless, so i need to press double E key for open console menu and then 5 options like
"i kill you"
"Die"
"You are noob"
"I love you lennon"
"Im idiot"
When player choose one hes saying this by himself like command in console "say im idiot"

old Re: double twice

The Gajos
BANNED Off Offline

Quote
I'm not sure if it will work /just edit it if won't 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
user = {}

function _join(id)
	user[id] = {}
	user[id].lastActionTime = os.time()
end

function _leave(id)
	user[id] = nil
end

function _use(id)
	user[id].actionTime = os.time()
	if user[id].actionTime - user[id].lastActionTime <= 2 then -- I hope it's in seconds, otherwise go use 200
		menu(id,'Poland the best,The Gajos,mafia_man,Avobolt')
	end
	user[id].lastActionTime = os.time()
end

-- you have to code menu hook --

addhook('join','_join')
addhook('leave','_leave')
addhook('use','_use')

old Re: double twice

muxarus
User Off Offline

Quote
@user lennon: I dont know how to use button E for opening lua menu.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("serveraction" , "_serveraction")
function _serveraction(id,action)
	if action==1 then 
		menu(id,"Console,i kill you,Die,You are noob,I love you lennon,Im idiot")
	end
end

addhook("menu","_menu")
function _menu(id,title,button)
	if title=="Console" then
		if button==1 then parse('say "i kill you"') end
		if button==2 then parse('say "Die"') end
		if button==3 then parse('say "You are noob"') end
		if button==4 then parse('say "I love you lennon"') end
		if button==5 then parse('say "Im idiot"') end
	end
end

old Re: double twice

BcY
Reviewer Off Offline

Quote
@user lennon:

Here you go man:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("serveraction" , "_serveraction")
function _serveraction(id,action)
     if action==1 then 
	 if (player(id,"team")==2) then
          menu(id,"Console,i kill you,Die,You are noob,I love you lennon,Im idiot")
     end
end
end

addhook("menu","_menu")
function _menu(id,title,button)
     if title=="Console" then
          if button==1 then parse('say "i kill you"') end
          if button==2 then parse('say "Die"') end
          if button==3 then parse('say "You are noob"') end
          if button==4 then parse('say "I love you lennon"') end
          if button==5 then parse('say "Im idiot"') end
     end
end

Admin/mod comment

Don't quote the user's post which is above you. Plus, next time choose the "Code" tag for codes instead of Spoiler. /user GeoB99

old Re: double twice

lennon
User Off Offline

Quote
Ye its working but why its so strange I mean when I test in New Game server its ok, but on dedicated server its working like this
Its saying commands "i killu" but dosnt indicate who wrote it ? why ?

old Re: double twice

The Gajos
BANNED Off Offline

Quote
msg('©050148252'..player(id,'name')..': ©255220000That's my message from Poland')
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview