English Mp_wpndmg and .cfg running *FIXED*

13 replies
Goto Page
To the start Previous 1 Next To the start
Up
sCy
User
Offline Off
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?
Code:
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
Memento mori.
25.05.12 08:32:58 pm
Up
omg
User
Offline Off
u should be able to put it in lua also
try being case sensitive; rcon commands usually require stuff like that
Code:
1
parse("mp_wpndmg MP5 100")

if it doesnt work, u could always put it in the autoexec.cfg file in sys/
will code for food
25.05.12 10:48:21 pm
Up
sCy
User
Offline Off
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
Memento mori.
25.05.12 11:09:05 pm
Up
omg
User
Offline Off
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
will code for food
25.05.12 11:12:30 pm
Up
sCy
User
Offline Off
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.
Memento mori.
25.05.12 11:16:53 pm
Up
omg
User
Offline Off
r u looking for something like this?
Code:
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
Code:
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
will code for food
25.05.12 11:21:26 pm
Up
sCy
User
Offline Off
Still didnt work. Its either my cs2d installation or some other nasty bug..
Anyway, how can this be possible. Also, I used this code:
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..
Memento mori.
25.05.12 11:25:13 pm
Up
omg
User
Offline Off
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
will code for food
25.05.12 11:27:45 pm
Up
sCy
User
Offline Off
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).
Memento mori.
26.05.12 06:21:22 am
Up
Cure Pikachu
User
Offline Off
Ever tried this?
Code:
1
parse("mp_wpndmg \"MP5\" 100")
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
26.05.12 06:48:26 am
Up
omg
User
Offline Off
user Cure Pikachu has written:
Ever tried this?
Code:
1
parse("mp_wpndmg \"MP5\" 100")

whats with the backslashes? it already works fine as is
will code for food
26.05.12 09:58:56 am
Up
sCy
User
Offline Off
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...
Memento mori.
26.05.12 10:08:22 am
Up
Cure Pikachu
User
Offline Off
Odd, because it worked in my CS2D. Not joking.
But here. Something like this.
Code:
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
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
26.05.12 05:31:57 pm
Up
sCy
User
Offline Off
@user Cure Pikachu: Nope, still not working. Tried to reinstall, redo the script, all of those, no effect. Well, starts to be VERY odd..
Memento mori.
To the start Previous 1 Next To the start