Forum

> > CS2D > Scripts > Money getting added
Forums overviewCS2D overview Scripts overviewLog in to reply

English Money getting added

3 replies
To the start Previous 1 Next To the start

old Money getting added

iCe4147
User Off Offline

Quote
Hi, Im trying to fix my script that after winning a round you get some cash for some reason i cant stop it the script I used is:

1
2
3
4
5
6
7
8
addhook("startround","nowinmoney")
function nowinmoney()
if player(id,"team") == 1 then
for id=1,32 do
parse("setmoney "..id.." 50")
end
end
end

Every round 1400 cash is added can anyone help me out so this wont happen?

old Re: Money getting added

DannyDeth
User Off Offline

Quote
There is nothing happening. The money you are receiving is from CS2D, not your script. id is not defined in a startround hook, nor did you even add it to the parametre list.

1
2
3
4
5
6
7
8
addhook("startround","give_moenaht")
function give_moenaht()
	for(i = 1, tonumber(game("sv_maxplayers"))) do
		if(player(i,"team") == 1) then
			parse("setmoney "..i.." ".. player(i,"money")+2500))
		end
	end
end

EDIT: Btw, you want the money only to go to T? Remove the 'if' statement if you don't want it like that.

old Re: Money getting added

sheeL
User Off Offline

Quote
1
2
3
4
5
6
addhook("spawn","am")
function am(p)
     if game("mp_startmoney")=="16000" then
          parse("setmoney "..p.." 16000")
     end
end

old Re: Money getting added

iCe4147
User Off Offline

Quote
@DannyDeth

Actually what I wanted was to prevent the money from being added. Im sorry but i also forgot to mention that the game mode was Zombies.

Edit: This usually happens when the round time gets finished up.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview