Forum

> > CS2D > Servers > Money error
Forums overviewCS2D overview Servers overviewLog in to reply

English Money error

12 replies
To the start Previous 1 Next To the start

old Money error

Yashukiller
User Off Offline

Quote
Guys,
i have standard server with map de_cs2d . when player play in it , the money is decreased to 0 , so nobody cant buy anything , i had done all,spawn money = 16000 and i m using yank's admin lua .
i want normal to inf can anybody help me.

old Re: Money error

Yunu
User Off Offline

Quote
1
2
3
4
5
6
addhook("startround","yu")
function yu(sa)
for id = 1,32 do
parse("setmoney "..id.." 16000")
end
end
or
cs2d cmd mp_startmoney

old Re: Money error

Yashukiller
User Off Offline

Quote
@user Yunu: but i want not after joining i want it in when player joined ,he uses money,the money is set inf

old Re: Money error

Infinite Rain
Reviewer Off Offline

Quote
Wait so you want money to be infinite?

1
2
3
4
5
6
addhook('second', 'second')
function second()
 for k, v in pairs(player(0, 'tableliving')) do
  parse('setmoney '.. v ..' 16000')
 end
end

Did not test, not sure if works.

old Re: Money error

J192
User Off Offline

Quote
Can't you set it to $16000 whenever a player buys instead of every second?

Edit: grammor fix
edited 1×, last 30.03.15 12:57:31 pm

Admin/mod comment

Removed quote. /user useigor

old Re: Money error

Infinite Rain
Reviewer Off Offline

Quote
@user J192:
It doesn't really matter. In all honesty I was just too lazy to check the arguments of a buy hooked function. But if you want to be mega efficient, then you can do that.

Edit:
1
2
3
4
addhook('buy', 'buy')
function buy(id, weapon)
 parse('setmoney '.. id ..' 16000')
end

It was more simple actually.

old Re: Money error

Talented Doge
User Off Offline

Quote
Why nobody think of setting money at spawn...

1
2
3
4
5
6
yuki = {}

addhook("spawn", "yuki.spawn")
function yuki.spawn(id)
	parse("setmoney "..id.." 16000")
end

much easier right

old Re: Money error

J192
User Off Offline

Quote
Here's the full script. Untested, of course.
1
2
3
4
5
6
7
8
9
addhook("spawn", "spawn")
function spawn(id)
	parse("setmoney "..id.." 16000")
end

addhook("buy", "buy")
function buy(id, weapon)
	parse("setmoney "..id.." 16000")
end

old Re: Money error

_Yank
User Off Offline

Quote
@user J192: Nope,
1
2
3
4
addhook("buy", "buy")
function buy(id, weapon)
	parse("setmoney "..id.." 16000")
end
is more than enough.

old Re: Money error

J192
User Off Offline

Quote
Wouldn't players start out with $800 before they buy?

Edit: Oh wait, I forgot that you can set the starting money via server options.

old Re: Money error

_Yank
User Off Offline

Quote
@user J192: That doesn't matters if every time you buy something you get 16000 money before. (In case you don't know, hooks are ran before their actions get performed)
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview