Forum

> > CS2D > Scripts > Mp_wpndmg and .cfg running *FIXED*
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Mp_wpndmg and .cfg running *FIXED*

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Zitieren
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.
3× editiert, zuletzt 27.05.12 00:06:45

alt Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

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

alt Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

Zitieren
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

alt Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Zitieren
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?
1× editiert, zuletzt 25.05.12 23:12:34

alt Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

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

alt Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Zitieren
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...
1× editiert, zuletzt 25.05.12 23:21:26

alt Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

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

alt Re: Mp_wpndmg and .cfg running *FIXED*

omg
User Off Offline

Zitieren
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
1× editiert, zuletzt 25.05.12 23:30:48

alt Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

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

alt Re: Mp_wpndmg and .cfg running *FIXED*

sCy
User Off Offline

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

alt Re: Mp_wpndmg and .cfg running *FIXED*

Cure Pikachu
User Off Offline

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