Config execution through scripting?
Moderator: Core Staff
Config execution through scripting?
Is it possible to have it so that when someone activates a trigger, a config (included in the .pk3 file) executes? If not is anything similar possible?


-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Its possible but it wont work how you want it to 
Any config that is executed through a script is server side and does not apply to clients...

Any config that is executed through a script is server side and does not apply to clients...

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Again, those will affect the server CoD files not the players, unless the player is playing locally.Pedsdude wrote:Ah... fair enough. Unless the person is playing it on their own computer?
What about doing it so that when they activate the trigger something like cg_hudalpha changes, or drawgun etc?
Not sure how it works with cheat protection, you can only try it

BTW, you dont need a script to change a cvar, just use
Code: Select all
self setCvar(("<cvar>"), "<var>");

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
So that won't work on a public server, only if the player is playing locally?Drofder2004 wrote:where cvar is the cvar you change (cg_hudalpha) and var is the variable (0.1, etc)Code: Select all
self setCvar(("<cvar>"), "<var>");


Code: Select all
self setCvar(("<cvar>"), "<var>");
eg
"Pedsdude" runs trough a trigger
then print a line
iprintlnbold("Pedsdude has run trough a trigger"); <-- this is a message to all
self iprintlnbold ("you just ran trough a trigger"); <-- this is a message to you alone
so you see, it doesnt mather if its played local, or public, the outcome is always the same.
So I could have:
And it would remove the person's HUD when they set off a trigger?
Code: Select all
self setCvar(("cg_hudalpha"), "0");


-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
trial and error.Pedsdude wrote:So I could have:
And it would remove the person's HUD when they set off a trigger?Code: Select all
self setCvar(("cg_hudalpha"), "0");
Make a map with nothing but a skybox and a trigger and then get someone on a test server with you, and only 1 person touch trigger.


Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: Bing [Bot] and 4 guests