Forum

> > CS2D > Scripts > items for use, else will not.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch items for use, else will not.

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt items for use, else will not.

Mora
User Off Offline

Zitieren
Hello all
i wanna ask you, how i can make this:
example we have menu:
1
menu(id,"ae,1,2,3")
we have function of this menu:
1
if title=="ae"... balbalblaa
we have function of button(example 1):
1
if button == 1 then
and here is:
If player have in inventory HE grenade and Flare(example items), then if press button will ok, else if we dont have this items, then by pressin button will tell msg2(id,"You dont have items, for use this button")
Possible it?
Thanks

alt Re: items for use, else will not.

Dousea
User Off Offline

Zitieren
1
2
3
4
5
6
7
function checkitem (id, itemid)
	for key, item in pairs (playerweapons (id)) do
		if (item == itemid) then
			return true
		end
	end
end
1
2
3
4
5
6
7
8
9
if (title == "ae") then
	if (button == 1) then
		if (checkitem (id, 51) and checkitem (id, 54)) then
			-- OK
		else
			msg2 (id, "You don't have one of items for this button")
		end
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht