edited 1×, last 24.06.11 10:45:25 pm
Forum
CS2D General entity that sets your moneyentity that sets your money
3 replies 1
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
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
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!
1