Forum

> > CS2D > Scripts > Need Help with Menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need Help with Menu

5 replies
To the start Previous 1 Next To the start

old Need Help with Menu

Bloodwing
User Off Offline

Quote
Hey dudes,
i can't script lua,i dont understand,
so I need help.
I want a menu on F2 that shows all player names,
and if i click them this player gots speed -100.
Only for usgn xxxxx
pls help

i started like this
1
2
addhook("menu","frzmenu")
function frzmenu(id,title,button)

old Re: Need Help with Menu

Krombac
User Off Offline

Quote
First give us the all file, not just two lines...

By me I think like this to activate a menu (f2) :

1
2
3
4
5
6
addhook("serveraction","action1")
         function action1(id, action)
                  if action==1 then
                  menu(id,"title,button1,button2,button3") 
                  end
         end

Change buttons to your action buttons.
Example : menu(id,"Buy menu,Buy deagle,Buy ak47,Buy m4a1")

old Re: Need Help with Menu

RAVENOUS
BANNED Off Offline

Quote
You need to trigger the menu function to call the menu hook. A simple version would be:

serveraction() -> menu() (function) -> calls menu() hook

old Re: Need Help with Menu

Yates
Reviewer Off Offline

Quote
user Krombac has written
1
2
3
4
5
6
addhook("serveraction","action1")
         function action1(id, action)
                  if action==1 then
                  menu(id,"title,button1,button2,button3") 
                  end
         end

Why do you have button1, button2 and button 3. Just use botton and then elseif button == 2 then. What you did is a waste of time

old Re: Need Help with Menu

EngiN33R
Moderator Off Offline

Quote
user Yates has written
Why do you have button1, button2 and button 3. Just use botton and then elseif button == 2 then. What you did is a waste of time


He wrote button1 button2 and button3 to demonstrate different button names.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview