Forum

> > CS2D > Scripts > what wrong with it
Forums overviewCS2D overview Scripts overviewLog in to reply

English what wrong with it

7 replies
To the start Previous 1 Next To the start

old what wrong with it

Mami Tomoe
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
parse("mp_building_limit Barricade 99999")
parse("mp_building_limit 'Barbed Wire' '99999'")
parse("mp_building_limit 'Wall I' '99999'")
parse("mp_building_limit 'Wall II' '99999'")
parse("mp_building_limit 'Wall III' '99999'")
parse("mp_building_limit 'Gate Field' '99999'")
parse("mp_building_limit Turret 99999")
parse("mp_building_limit Dispenser 99999")
parse("mp_building_limit Supply 99999")

i tried it but it make errors in console
Spoiler >

old Re: what wrong with it

alex72super
User Off Offline

Quote
Well, try:

1
2
3
4
5
6
7
8
9
10
11
parse('mp_building_limit "Barricade"  999')
parse('mp_building_limit "Barbed Wire" 999')
parse('mp_building_limit "Wall I" 999')
parse('mp_building_limit "Wall II" 999')
parse('mp_building_limit "Wall III" 999')
parse('mp_building_limit "Gate Field" 999')
parse('mp_building_limit "Supply" 999')
parse('mp_building_limit "Dispenser" 999')
parse('mp_building_limit "Turret" 999')
parse('mp_building_limit "Teleporter Entrance" 999')
parse('mp_building_limit "Teleporter Exit" 999')

Unstested。

old Re: what wrong with it

Rainoth
Moderator Off Offline

Quote
Please note that what I'm about to post isn't my thoughts. I'm simply posting this because I think this will help the one with the problem

Yates has written
Replace the following buildings with this:
1
2
3
4
5
parse("mp_building_price \"Barbed Wire\" 0")
parse("mp_building_price \"Wall I\" 0")
parse("mp_building_price \"Wall II\" 0")
parse("mp_building_price \"Wall III\" 0")
parse("mp_building_price \"Gate Field\" 0")
Other buildings need no quotes around their name..

old Re: what wrong with it

DC
Admin Off Offline

Quote
The CS2D command parser only accepts " (double quotes) as string delimiter (it doesn't accept single quotes '). Lua accepts ", ' and even some more. So the most beautiful solution (without using \ for escaping) would be something like
1
2
parse('mp_building_price "Barbed Wire" 0')
-- and so on...

Or (even better): A wrapper function
1
2
3
4
5
6
7
function setPrice(building, price)
	parse('mp_building_price "'..building..'" '..price)
end

setPrice("Barbed Wire", 0)
setPrice("Wall I", 0)
-- and so on...

old Re: what wrong with it

Eizdealer
BANNED Off Offline

Quote
@user DC: Yes very easy to make. If also does not take many resources and time consuming. I think this is already fixed.

old Re: what wrong with it

Mami Tomoe
User Off Offline

Quote
user DC has written
The CS2D command parser only accepts " (double quotes) as string delimiter (it doesn't accept single quotes '). Lua accepts ", ' and even some more. So the most beautiful solution (without using \ for escaping) would be something like
1
2
parse('mp_building_price "Barbed Wire" 0')
-- and so on...

Or (even better): A wrapper function
1
2
3
4
5
6
7
function setPrice(building, price)
	parse('mp_building_price "'..building..'" '..price)
end

setPrice("Barbed Wire", 0)
setPrice("Wall I", 0)
-- and so on...


thanks but im doesnt want to change theyr price i want to change the limt
ill check out the other posts and try to use it

old Re: what wrong with it

DC
Admin Off Offline

Quote
Ooops. I didn't pay attention and somehow mixed that up, sorry. Just replace "price" with "limit". It's works exactly the same way.

old Re: what wrong with it

Dousea
User Off Offline

Quote
1
2
3
4
5
local buildings = {"Barricade", "Barbed Wire", "Wall I", "Wall II", "Wall III", "Gate Field", "Supply", "Dispenser", "Turret"}

for key, value in pairs (buildings) do
	parse ("mp_building_limit \"" .. value .. "\" 9999")
end
Actually you can do this as simple as that. I haven't test it yet but I am sure this would work.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview