Forum

> > CS2D > Scripts > Mp_wpndmg and .cfg running *FIXED*
Forums overviewCS2D overview Scripts overviewLog in to reply

English Mp_wpndmg and .cfg running *FIXED*

13 replies
To the start Previous 1 Next To the start

old Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
I am trying to increase the wpndmg with lua.
When I enter mp_wpndmg mp5 100, the damage goes to 100. But, if I have parse("mp_wpndmg mp5 100"), the damage stays same. Any ideas?

More:

It appears you have to put the mp_wpndmg to .cfg file.
I'd like to see that you could put it in lua, but oh well.
How you run .cfg files from .lua?
Something like this?
1
for line in io.lines(nz_SETTINGS.."game settings.cfg") do parse(line) end

EDIT: The problem was that my CS2D install was fucked up. Thanks for everyone for helping.
edited 3×, last 27.05.12 12:06:45 am

old Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Quote
u should be able to put it in lua also
try being case sensitive; rcon commands usually require stuff like that
1
parse("mp_wpndmg MP5 100")
if it doesnt work, u could always put it in the autoexec.cfg file in sys/

old Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
As, I should describe the 2nd problem more. I need to be able to run the .cfg files while playing (and like it does even change the game!), what makes this pretty hard. Also, the parse for mp_wpndmg doesnt work, so suppose I have to use .cfg files

old Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Quote
when do u want to be able to use the command? just whenever u trigger it? i guess what im asking is what do u want the trigger to be?
edited 1×, last 25.05.12 11:12:34 pm

old Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
Well, I mean, when the playerCount changes (not showed), like, since parse("mp_damagefactor") doesnt work for me, I probably could use dofile("playerCount1.cfg") or something like that. But, Im still thinking a way to activate the .cfg files for roundstart wpndmg too.. Wondering what was the command for running things inside .cfg files.

old Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Quote
r u looking for something like this?
1
2
3
4
addhook("startround","wpndmg")
function wpndmg(mode)--mode isnt actually used here
	parse("mp_wpndmg MP5 100")
end
i tried this code and it works just fine, so im not sure why ur code has problems
also, putting the line
1
mp_wpndmg MP5 100
in autoexec.cfg has the same effect, as long as u dont want to modify its dmg later

attempting to dofile the .cfg wont work, as its not in lua...
edited 1×, last 25.05.12 11:21:26 pm

old Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
Still didnt work. Its either my cs2d installation or some other nasty bug..
Anyway, how can this be possible. Also, I used this code:
1
2
3
4
5
6
7
8
9
10
11
12
addhook("startround", "spawngun")
function spawngun(mode)
	parse("mp_wpndmg MP5 100")
	parse("spawnitem "..math.random(20,24).. " 14 14")
	parse("spawnitem "..math.random(20,24).. " 16 14")
	parse("spawnitem "..math.random(20,24).. " 22 14")
	parse("spawnitem "..math.random(10,11).. " 18 14")
	parse("spawnitem "..math.random(20,24).. " 14 19")
	parse("spawnitem "..math.random(20,24).. " 16 19")
	parse("spawnitem "..math.random(20,24).. " 22 19")
	parse("spawnitem "..math.random(10,11).. " 18 19")
end
And, that SHOULDNT have bugs..

old Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Quote
check ur console after ur server loads for any errors (theyll be in red text)

if nothing shows up AND the items still spawn, it might just be the installation and u may want to reinstall cs2d

make sure u didnt accidentally change mp5's dmg value somewhere else (although this is very unlikely...who would be clueless enough?)

if the lua isnt in server.lua, make sure ur running the .lua file from server.lua
edited 1×, last 25.05.12 11:30:48 pm

old Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
There are no red texts - I know enough of lua to know that they arent good. Second, I will reinstall the cs2d. Third, I go to sleep, its so late (0:27am).

old Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Quote
Didnt work again. Tried to reinstall and with backslashes.
Seems that only way to be able to run them from game is io.lines, but I dont know how to code that...

old Re: Mp_wpndmg and .cfg running *FIXED*

Cure Pikachu
User Off Offline

Quote
Odd, because it worked in my CS2D. Not joking.
But here. Something like this.
1
2
3
4
5
6
7
8
9
function loadfuncs()
	local f = io.open(nz_SETTINGS.."game settings.cfg","r")
	if f ~= nil then
		for line in f:lines() do
			parse(line)
		end
		f:close()
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview