Forum

> > CS2D > Scripts > Editing supply menu with LUA
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Editing supply menu with LUA

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Editing supply menu with LUA

Vetle
BANNED Off Offline

Zitieren
user Yates hat geschrieben
cs2d cmd mp_supply_items weaponid,weaponid,weaponid etc.

You can also use names, but then you would have to use " around the whole thing if you use weapons that have a space. For ex. Tactical Shield.


The thing is i want to make way more items than 9..
Actually i want to make pages too soooo...

Thats why i am asking how to do it with " LUA " not without.

alt Re: Editing supply menu with LUA

EngiN33R
Moderator Off Offline

Zitieren
user Alistaire hat geschrieben
user Vetle hat geschrieben
Thats why i am asking how to do it with " LUA " not without.


mp_supply_items is Lua, fyc.


Err, no it's not. It's a console command.

@user Vetle: You'll need to check if a player presses E near a supply, then open a custom paged menu with items in it. I have that kind of function somewhere, I'll give it to you when I find it.

alt Re: Editing supply menu with LUA

Apache uwu
User Off Offline

Zitieren
Not only "near" you need to check if their rotation is facing the supply in relation to their position.

Someone should really make this--it's a good idea.

alt Re: Editing supply menu with LUA

EngiN33R
Moderator Off Offline

Zitieren
user Apache uwu hat geschrieben
you need to check if their rotation is facing the supply in relation to their position.


What for? Can't you use supply even if facing outward? I think you just need to be on an adjacent tile.

alt Re: Editing supply menu with LUA

Happy eyes
User Off Offline

Zitieren
user EngiN33R hat geschrieben
user Apache uwu hat geschrieben
you need to check if their rotation is facing the supply in relation to their position.


What for? Can't you use supply even if facing outward? I think you just need to be on an adjacent tile.


Just chcked, you need to be facing to the supply to open the menu, not only to be on the right tile.

alt Personal supplies

Powermonger
User Off Offline

Zitieren
May I ask, is it possible to make personal supply items, or are they always same for all users?

alt Re: Editing supply menu with LUA

Yates
Reviewer Off Offline

Zitieren
user Powermonger hat geschrieben
May I ask, is it possible to make personal supply items, or are they always same for all users?

You can create your own menu once using E near a supply. But you would need to know Lua to do such a thing.

alt Re: Editing supply menu with LUA

Powermonger
User Off Offline

Zitieren
user Yates hat geschrieben
user Powermonger hat geschrieben
May I ask, is it possible to make personal supply items, or are they always same for all users?

You can create your own menu once using E near a supply. But you would need to know Lua to do such a thing.


I have learned how to make custom menus, but I'm not sure about the use hook.

I think I'll use the event 150
Spoiler >
am I right?

And does this allow to open a menu such as:
menu(id,"Menu,Item 1,Item 2,Item 3,Item 4") ?

alt Re: Editing supply menu with LUA

omg
User Off Offline

Zitieren
this is what i do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("usebutton","unexciting_function")
function unexciting_function(id,xtile,ytile)
	if xtile>25 and xtile<29 and ytile>38 and ytile<42 then
		menu(id,"title,blah...")
	elseif ...
		...
	end
end

addhook("menu","exciting_function")
function exciting_function(id,title,button)
	if title=="title" then
		...
	elseif title==...
		...
	end
end
scripts like this already existed a long time ago lol
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht