Forum

> > CS2D > General > entity that sets your money
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch entity that sets your money

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

Umfrage Umfrage

should DC create a entity to set your money? example: when i press a button, i lose 200 money but i spawn a item called bandage

Nur registrierte Benutzer können abstimmen
Yes
23,53% (4)
No
64,71% (11)
Maybe
11,76% (2)
17 Stimmen abgegeben

alt Re: entity that sets your money

Apache uwu
User Off Offline

Zitieren
Yeah if you have a citylife map it's destined that you already have a lua that goes along with it.

It is easily done with lua, suppose your reason was the create a "purchase button" where when you press it--you would lose a certain amount of money for the trade of a weapon or parsed command.

Here is an example.

1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("usebutton","_button")

function _button(id,x,y)
	if x==XPOS and y==YPOS then
		if player(id, "money")>=5000 then
			parse("setmoney "..id.." "..player(id, "money")-5000)
			parse("equip "..id.." 20")
			msg2(id, "You purchased a MP5!")
		else
			msg2(id, "Sorry but you do not have enough money.")
		end
	end
end

You need to edit XPOS and YPOS to where your button is located.

Hope this helps!
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht