Combat mode

RedLink

New Member
Hi all.

Default combat mode is 30 seconds.
How to make it, ex, 5 minutes?
i found this code, but his not work.

player setVariable["startcombattimer",1,true];
player setVariable ["combattimeout",3000,true];
player setVariable ["startcombattimer",0];
dayz_combat =1;

Any ideas?
 
Are you sure that's what you want to do? Most people really dislike the combat timer and I usually disable it completely. So for 5 minutes after you shoot a zombie your players will not be able to quit the game, give a blood bag or any of the other normal actions that are limited by the combat timer.

Anyways why does that not work? The 3000 looks like it should be enabling the combat timer for 50 minutes. 300 would be 5 minutes. Is there something else that isnt working with the timer?

I searched the github and didnt see that code, so I am going to assume its in the dayz_code.pbo ... did you import the file into your mission and retarget in compiles.sqf?
 
yes. 300 ))
in my server installed script Blowout. when it has only just begun, the players go to the lobby and wait out for him there. So I want to make when does it start, combat mode for 5 minutes. I know where to write, but I do not know how to realize it.
 
You are editing a dayz_code.pbo file.
Did you import that file into your mission and edit the mission copy?
Did you import compiles.sqf into your mission and edit the line that points to your file to have your mission file path?

Post your mission to google drive etc, and post the link if it doesnt work.
 
Is this the code and file you are editing in dayz_code\system\player_spawn_2.sqf ?
iOwwR0F.png


In your compiles.sqf, its still loading the file in dayz_code.pbo. If you edit ANY file in dayz_code you MUST copy it to your mission and change the location in compiles.sqf
57KDfoV.png

I edited the above line to this:
player_spawn_2 = compile preprocessFileLineNumbers "custom\fixes\player_spawn_2.sqf";


I copied that file into your custom\fixes folder and edited the compiles.sqf to point to the mission copy. Now you can edit the combattimeout in your mission custom\fixes\player_spawn_2.sqf ....

If you were editing some other file, let me know, thats the only place I saw to edit that code.
 
in the blowout_client.sqf

if (ns_blowout_dayz) then {
player setVariable["startcombattimer", 1, true];
};

this script must change for 5 minutes combat time
 
all that code does is set a variable on the player saying that combatmode is active.

Look at the code I took a screenshot of in my previous post.
  • Line 218: Gets the variable "combatmode" from the player that is being set in blowout_client.sqf
  • Line 219: Is that variable set to "1" which means the player should have the combattimer running.
  • Line 220: Sets the combattimeout to be 30 seconds from now.
If you set combattimeout to 5 minutes in blowout_client.sqf, it will be overwritten in player_spawn_2.sqf
You would have to copy the code and create a new variable to use just for the blowouts.

I have an easier solution that MIGHT work, you test it and see.
In dayz_spaceinterrupt.sqf (in your mission folder custom\snap_pro folder)

there is this code that disables quitting .

Code:
// Disable ESC after death
if (_dikCode == 0x01 && r_player_dead) then {
    _handled = true;
};

Lets change it to this.
Code:
// Disable ESC after death
if ((_dikCode == 0x01 ) && (r_player_dead || ns_blowout)) then {
    _handled = true;
};

This SHOULD disable the escape key during a blowout.
 
the ESC menu is not working always
in my init.sqf ns_blowout = true;
if i set ns_blowout = false; - blowout does not working
 
Last edited:
i create new variable in the init.sqf
ns_blowout2= false;
and add they in blowout_client.sqf
at the beginning - ns_blowout2= true;
at the end - ns_blowout2= false;

at the dayz_spaceInterrupt.sqf change
if ((_dikCode == 0x01 ) && (r_player_dead || ns_blowout2)) then {

Its works. Nice ) Thanks for that.
 
the ESC menu is not working always
in my init.sqf ns_blowout = true;
if i set ns_blowout = false; - blowout does not working
in your init.sqf, ns_blowout controls whether your server will have blowouts or not. If you set it to false, then you are disabling blowouts. So it has to be true if you want the blowouts.

So I made a mistake in the code I gave you, because the ns_blowout is always true. What you did is what I was thinking, a variable that tells you when the blowout is actually happening. Glad you got it all fixed up and its working.
 
Back
Top