Forum

> > CS2D > Servers > Money error
ForenübersichtCS2D-Übersicht Servers-ÜbersichtEinloggen, um zu antworten

Englisch Money error

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Money error

Yashukiller
User Off Offline

Zitieren
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.

alt Re: Money error

Yunuu
User Off Offline

Zitieren
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

alt Re: Money error

Infinite Rain
Reviewer Off Offline

Zitieren
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.

alt Re: Money error

J192
User Off Offline

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

Edit: grammor fix
1× editiert, zuletzt 30.03.15 12:57:31

Admin/Mod Kommentar

Removed quote. /user useigor

alt Re: Money error

Infinite Rain
Reviewer Off Offline

Zitieren
@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.

alt Re: Money error

Talented Doge
User Off Offline

Zitieren
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

alt Re: Money error

J192
User Off Offline

Zitieren
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

alt Re: Money error

_Yank
User Off Offline

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

alt Re: Money error

J192
User Off Offline

Zitieren
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.

alt Re: Money error

_Yank
User Off Offline

Zitieren
@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)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Servers-ÜbersichtCS2D-ÜbersichtForenübersicht