Forum
Scripts
Editing supply menu with LUA
Editing supply menu with LUA
12 replies
1

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.
Yates has written
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.
Vetle has writtenThats why i am asking how to do it with " LUA " not without.
mp_supply_items is Lua, fyc.
Alistaire has written
Vetle has writtenThats 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.
@
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. Someone should really make this--it's a good idea.
Apache uwu has writtenyou 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.
EngiN33R has written
Apache uwu has writtenyou 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.
Powermonger has writtenMay 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.
Yates has written
Powermonger has writtenMay 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 150am I right?
And does this allow to open a menu such as:
menu(id,"Menu,Item 1,Item 2,Item 3,Item 4") ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
Good to know!
Thanks guys for helping me
1

Offline
