
Reset all dvars script help
Moderator: Core Staff
Reset all dvars script help
Hi i have made a script that changes player jump_height and g_speed along with a few other dvars. I need a trigger to push that enables all the default values. plz help? 

Re: Reset all dvars script help
i got it working.
Re: Reset all dvars script help
okay so i made this script that changes the gravity, but it was meant for player only, and it seems that it changes the entire server. IF the server rotates when grav is not corrected, then the rest of the maps on rotation get screwed up. I would like to know if there is a way i could execute a script that happens when the server rotates. Also, for a secret, i want the player to have to be finished before he is allowed to do the secret. i tried the following if statement but it doesnt work. plz help on both of these?
if(user.done = false)
{
player suicide();
}
if(user.done = false)
{
player suicide();
}
-
- CJ Worshipper
- Posts: 289
- Joined: December 5th, 2009, 7:12 am
- Location: Australia
Re: Reset all dvars script help
Use a double-equals sign '==' when comparing two values. A single equals sign '=' assigns a value to a variable.Vartazian wrote:if(user.done = false)
{
player suicide();
}
Re: Reset all dvars script help
First determine wheter you want to use "user" or "player".Vartazian wrote:okay so i made this script that changes the gravity, but it was meant for player only, and it seems that it changes the entire server. IF the server rotates when grav is not corrected, then the rest of the maps on rotation get screwed up. I would like to know if there is a way i could execute a script that happens when the server rotates. Also, for a secret, i want the player to have to be finished before he is allowed to do the secret. i tried the following if statement but it doesnt work. plz help on both of these?
if(user.done = false)
{
player suicide();
}
Then, do either:
if(!user.done)
user suicide();
or
if(!player.done)
player suicide();
Re: Reset all dvars script help
Ah yes thanks for the help guys, i figured the suicide out
But any help with regards to the other question about resetting the values g_speed, jump_height, and g_gravity before the map rotates?

-
- CJ Worshipper
- Posts: 289
- Joined: December 5th, 2009, 7:12 am
- Location: Australia
Re: Reset all dvars script help
Try "level waittill("game_ended");" and after that, use 'setDvar' to set their default values.Vartazian wrote:Ah yes thanks for the help guys, i figured the suicide outBut any help with regards to the other question about resetting the values g_speed, jump_height, and g_gravity before the map rotates?
Re: Reset all dvars script help
would that be inside of main then? because it has to execute before the server rotates. If its a trigger, then it would need to be touched or something like that.
-
- CJ Worshipper
- Posts: 289
- Joined: December 5th, 2009, 7:12 am
- Location: Australia
Re: Reset all dvars script help
Create a function called 'onGameEnd' and add the code above into the body. Then, thread it in your main function.
The notify string "game_ended" is notified when the game timer reaches 0, or when the server rotates the map (I believe).
Code: Select all
main()
{
thread onGameEnd();
}
onGameEnd()
{
level waittill("game_ended");
// set dvars here
}
Re: Reset all dvars script help
ty it seems as if this has worked!
Who is online
Users browsing this forum: No registered users and 11 guests