30 Sec. Godmode on Spawn - HELP to complete Script!!!

QueZ

Well-Known Member
Hey guys,

I am using Kris' script for 30 Seconds godmode on spawn. It's pretty good only 2 things strike me bad with it. SCRIPT: http://opendayz.net/threads/30-second-godmode-on-spawn.12407/

Here is my 1st problem (FIXED-HERE). Players simply need to log to lobby, load back in and rush the enemy player with his godmode on for 30 seconds. Not alright! I want to know if there's a line of code I can add that will not only let them keep godmode to protect against spawn killers for 30 seconds, but also NOT LET THE PLAYER SHOOT HIS WEAPON during this 30 seconds period?

Here is my 2nd problem (PRIORITY). When you are on the loading screen right before being ACTUALLY ingame, there is a temp bot that stands up (it's a bot of you), then when you're done loading and INgame the 30 seconds of godmode starts. Problem is the period when you load (on loading screen) your temp bot is 100% killable making spawn camping/killing very much possible still. Is there anything we can change in this script to make that "loading bot" not killable?

Any help would be very much appreciated and it can complete this wonderful script :)

Here is the current script (sqf)
Code:
waitUntil {(!isNull Player) and (alive Player) and (player == player) and (!isNil 'dayz_animalCheck')};
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
titleText ["Welcome to the Server!", "PLAIN DOWN", 3];
sleep 30;
titleText ["Goodluck!", "PLAIN DOWN", 3];
sleep 0.1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
 
I appreciate your time a lot. Can you help me see better what exactly I would need to add to my current code? Thanks again.

Try this, taken from kikyou2's safezone:
Code:
waitUntil {(!isNull Player) and (alive Player) and (player == player) and (!isNil 'dayz_animalCheck')};
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
_EH_Fired  = vehicle player addEventHandler ["Fired", { NearestObject [_this select 0,_this select 4] setPos[0,0,0]}];
titleText ["Welcome to the Server!", "PLAIN DOWN", 3];
sleep 30;
titleText ["Goodluck!", "PLAIN DOWN", 3];
sleep 0.1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
player removeEventHandler ["Fired", _EH_Fired];
 
Try this, taken from kikyou2's safezone:
Code:
waitUntil {(!isNull Player) and (alive Player) and (player == player) and (!isNil 'dayz_animalCheck')};
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
_EH_Fired  = vehicle player addEventHandler ["Fired", { NearestObject [_this select 0,_this select 4] setPos[0,0,0]}];
titleText ["Welcome to the Server!", "PLAIN DOWN", 3];
sleep 30;
titleText ["Goodluck!", "PLAIN DOWN", 3];
sleep 0.1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
player removeEventHandler ["Fired", _EH_Fired];

It works, it makes the bullets disappear (meaning bullets don't actually come out) and will last only 30 seconds like the god-mode. Thanks you so much sir. Credit will be thrown to you and kikyou2 for this. Now I only have one more minor problem. The Loading Bot is still killable, but right now 90% of spawn killing is gone!

Thanks again mate!
 
Here is my 2nd problem (PRIORITY). When you are on the loading screen right before being ACTUALLY ingame, there is a temp bot that stands up (it's a bot of you), then when you're done loading and INgame the 30 seconds of godmode starts. Problem is the period when you load (on loading screen) your temp bot is 100% killable making spawn camping/killing very much possible still. Is there anything we can change in this script to make that "loading bot" not killable?

Does anybody know if making a Spawn Bot (refered in my original post above) Godmode has to do with the following code found in dayz_server.PBO/compile/server_playerSetup.sqf and if so, how can I go about doing this?


ORIGINAL CODE
Code:
private["_dummy"];
_dummy = getPlayerUID _playerObj;
if ( _playerID != _dummy ) then {
    diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID];
    _playerID = _dummy;
};


WHAT I THINK WOULD WORK (1 see 3 options which would work? #1,2,3?)
Code:
private["_dummy"];
_dummy = getPlayerUID _playerObj;
if ( _playerID != _dummy ) then {
    diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID];
    _playerID = _dummy;
    dummy allowDamage false;      //This is way #1 (maybe with an underscore _ before dummy?)
    player allowDamage false;        //This is way #2 (maybe with an underscore _ before player?)
    object allowDamage false;        //This is way #3 (maybe with an underscore _ before object?)
};
 
Does anybody know if making a Spawn Bot (refered in my original post above) Godmode has to do with the following code found in dayz_server.PBO/compile/server_playerSetup.sqf and if so, how can I go about doing this?


ORIGINAL CODE
Code:
private["_dummy"];
_dummy = getPlayerUID _playerObj;
if ( _playerID != _dummy ) then {
    diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID];
    _playerID = _dummy;
};


WHAT I THINK WOULD WORK (1 see 3 options which would work? #1,2,3?)
Code:
private["_dummy"];
_dummy = getPlayerUID _playerObj;
if ( _playerID != _dummy ) then {
    diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID];
    _playerID = _dummy;
    dummy allowDamage false;      //This is way #1 (maybe with an underscore _ before dummy?)
    player allowDamage false;        //This is way #2 (maybe with an underscore _ before player?)
    object allowDamage false;        //This is way #3 (maybe with an underscore _ before object?)
};

#3 would not work, but it is worth testing the _dummy allowDamage false; and player allowDamage false;
 
So you think i should use _dummy or dummy (no underscore)? And yeah thought #3 wouldn't :p
 
So you think i should use _dummy or dummy (no underscore)? And yeah thought #3 wouldn't :p

_dummy because dummy isn't a variable.
Code:
_dummy = getPlayerUID _playerObj;

and because its getting the playerUID I don't think that the _dummy one will work either. but it is worth a shot
 
_dummy because dummy isn't a variable.
Code:
_dummy = getPlayerUID _playerObj;

and because its getting the playerUID I don't think that the _dummy one will work either. but it is worth a shot

_dummy does not work.... my next server restart, i'll test player
 
Back
Top