English how to not get the 2000 money after every round?

4 replies
Goto Page
To the start Previous 1 Next To the start
Up
Lordofspeed150
User
Offline Off
i want to get rid of the feature that when a new round starts, you get 2000 money. instead, i dont want to get any money at all after the round ends.

Admin/mod comment:

Wrong language section, moved. /user GeoB99
05.12.21 08:51:51 am
Up
Bowlinghead
User
Offline Off
You can delete it in the same second!
Code:
1
2
3
4
5
6
addhook("endround","er")
function er()
     for _, id in ipairs(player(0,"tableliving")) do
          parse("setmoney "..id.." "..(player(id,"money")-2000))
     end
end


You probably need more use-cases because the winner team is probably going to get more money than the loosing team. Also it depends on the exact win condition I think (which gamemode; wether bomb planted/defused or all enemys killed; wins in a row; etc)

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("endround","er")
function er(m)
     if (m==1) then -- TT wins
          -- Reduce money for all Terrors
          for _, id in ipairs(player(0,"team1living")) do
               parse("setmoney "..id.." "..(player(id,"money")-2200)) -- TTs loose more
          end
          -- Reduce all money for all Counter-Terrors
          for _, id in ipairs(player(0,"team12living")) do
               parse("setmoney "..id.." "..(player(id,"money")-1800)) -- CTs less
          end
     elseif (m==2) then -- CT wins

     elseif (...) then
     
     ...
     
     end
end


cs2d lua cmd player
cs2d lua hook endround
edited 1×, last 05.12.21 09:32:40 am
Share time limited free games here
05.12.21 10:53:38 am
Up
Mami Tomoe
User
Offline Off
This could help you on some cases cs2d cmd mp_dmspawnmoney
Look at me standing, here on my own again
05.12.21 09:07:03 pm
Up
mrc
User
Offline Off
user Bowlinghead has written:

Wrong, if he reduce money on endround he will still get money on startround.

I have this script, it's really easy to do.
CS2DBR @ Comunidade Brasileira de CS2D | https://www.cs2dbr.com
06.12.21 05:15:32 pm
Up
Bowlinghead
User
Offline Off
Ok, thanks for the hint @user mrc

Here is the way easier script:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--untested
local playerMoneyzz = {}

addhook("endround","OnEndround")
function OnEndround()
     playerMoneyzz = {}; -- reset table
     for _, id in ipairs(player(0,"table")) do
          playerMoneyzz[id] = player(id,"money");
     end

end


addhook("startround","OnStartround")
function OnStartround()
     for id,euros in pairs(playerMoneyzz) do
          parse("setmoney "..id.." "..euros)
     end
end

addhook("leave","OnLeave")
function OnLeave(id)
     playerMoneyzz[id] = nil; -- delete money value if someone leaves
end


Note that this only works because the endround money is given to you at the start of the next round!
Share time limited free games here
To the start Previous 1 Next To the start