Forum

> > CS2D > General > entity that sets your money
Forums overviewCS2D overviewGeneral overviewLog in to reply

English entity that sets your money

3 replies
To the start Previous 1 Next To the start

Poll Poll

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

Only registered users are allowed to vote
Yes
23.53% (4)
No
64.71% (11)
Maybe
11.76% (2)
17 votes cast

old Poll entity that sets your money

XeniTh
User Off Offline

Quote
i would need it for citylife... and i vote maybe. what do you think?
edited 1×, last 24.06.11 10:45:25 pm

old Re: entity that sets your money

Apache uwu
User Off Offline

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