Forum

> > CS2D > Scripts > Editing supply menu with LUA
Forums overviewCS2D overview Scripts overviewLog in to reply

English Editing supply menu with LUA

12 replies
To the start Previous 1 Next To the start

old Re: Editing supply menu with LUA

Vetle
BANNED Off Offline

Quote
user Yates has written
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.

old Re: Editing supply menu with LUA

EngiN33R
Moderator Off Offline

Quote
user Alistaire has written
user Vetle has written
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.

old Re: Editing supply menu with LUA

Apache uwu
User Off Offline

Quote
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.

old Re: Editing supply menu with LUA

EngiN33R
Moderator Off Offline

Quote
user Apache uwu has written
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.

old Re: Editing supply menu with LUA

Happy eyes
User Off Offline

Quote
user EngiN33R has written
user Apache uwu has written
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.

old Personal supplies

Powermonger
User Off Offline

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

old Re: Editing supply menu with LUA

Yates
Reviewer Off Offline

Quote
user Powermonger has written
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.

old Re: Editing supply menu with LUA

Powermonger
User Off Offline

Quote
user Yates has written
user Powermonger has written
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") ?

old Re: Editing supply menu with LUA

omg
User Off Offline

Quote
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview