Forum

> > CS2D > Scripts > Menu only for F2/F3 ?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Menu only for F2/F3 ?

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Menu only for F2/F3 ?

Remulux
User Off Offline

Zitieren
Hi, is it possible to a menu of classes open only when press F2 or F3?

Sorry for my english.

DELETE
1× editiert, zuletzt 05.12.13 12:58:37

alt Re: Menu only for F2/F3 ?

Necr0
User Off Offline

Zitieren
Mehr >


This should work.

alt Re: Menu only for F2/F3 ?

Rainoth
Moderator Off Offline

Zitieren
TheCode >


You should use cs2d lua hook serveraction for reference. Check the other hooks and what parameters they have.

alt Re: Menu only for F2/F3 ?

Necr0
User Off Offline

Zitieren
I don't get what you mean user Remulux.
It doesn't open the menu when you change the team.
Did you mean it is not working because it also opens when you press f4?
If that is what you mean please don't say it's not working.
You should describe what is wrong next time because you made me think it reports an error in the console.

alt Re: Menu only for F2/F3 ?

Rainoth
Moderator Off Offline

Zitieren
user Necr0 hat geschrieben
Did you mean it is not working because it also opens when you press f4?
You should describe what is wrong next time because you made me think it reports an error in the console.


Zitat
open only when press F2 or F3?


Isn't it clear enough ? Anyways, I think you just made it work in a way that it works on all keys and he took it as error. Give him time. I'm sure he'll understand what is what after a while.

alt Re: Menu only for F2/F3 ?

Remulux
User Off Offline

Zitieren
THX for help.

Scripting in lua I'm learning

But is it possible to show class menu on spawn?

Mehr >

I use only F2
1× editiert, zuletzt 03.12.13 16:42:11

alt Re: Menu only for F2/F3 ?

Rainoth
Moderator Off Offline

Zitieren
Dude. Lemme tell you something Engy taught me almost in the begining.

1
function name(a,b,c)

"function" - will begin DECLARING your function. Basically by writing "function" you tell the computer that you're making some kind of mechanism that may work in the future.

"name" - This is the name of your function. Try not to make the name as cs2d hooks or other functions that might already be declared if you use multiple scripts.

"()" - the brackets where you declare the arguments for the function

"a,b,c" - the actual arguments. You can name them whatever you want, what really matters is the ORDER. For example a is health, b is armor and c is speed. You can name them "speed,health,armor" and use "speed" to actually change health. It's not advised as you'll just confuse yourself, but what I mean is - it'll work as long you get the order right. One thing you should note is that you shouldn't try to name them after the functions (yet) or it might get a bit too complicated for you.

Now. cs2d lua hook spawn is what you need in spawn. CHECK THAT SITE. Seriously. Look up all the hooks and their arguments. Your function for class menu only requires ID ! It means that you can make a menu pop-up in any way you want, you just have to find a hook that stores id of a player. Sometimes ID may appear in shape of another expression in cs2d (for example "killer","victim","source" and similar) so keep that in mind too.

I hope this helps a lot. I'm sorry if it is a bit unclear to you but this is THE BASICS and if you can't understand it, you should try to ask someone else to explain the same thing.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht