General > Developers Corner

Setting Engine Cvars?

<< < (2/3) > >>

Avoid:
As I've written in my post earlier, simply put this into your Initialize hook.

You can either overwrite the hook or simply add to it. :)

PAL-18:
Oh.

I didn't notice; but i did add it to my GM:Initialize hook.  It didn't work.

Here's part of what it looks like:


--- Code: ---function GM:Initialize()
   MsgN("Trouble In Terrorist Town gamemode initializing...")
   ShowVersion()

   -- Force friendly fire to be enabled. If it is off, we do not get lag compensation.
   RunConsoleCommand("mp_friendlyfire", "1")
   
   -- NPC Cvars
   timer.Simple(0.1, function()
RunConsoleCommand("sk_barnacle_health", "1000")
RunConsoleCommand("sk_antlionguard_health", "300")
RunConsoleCommand("sk_antlionguard_dmg_charge", "7")
RunConsoleCommand("sk_antlionguard_dmg_shove", "2")
RunConsoleCommand("sk_antlion_health", "150")
RunConsoleCommand("sk_antlion_jump_damage", "5")
RunConsoleCommand("sk_antlion_swipe_damage", "1")
end)
--- End code ---

PAL-18:
Sooo ... any idea why it doesnt work?

Zmaster:
Does it give an error?

PAL-18:
Nope, no errors.  It just doesn't seem to accept the cvar.

Oddly if i do the cvar through rcon remotely or ulx rcon it runs fine.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version