Jump to content
  • 0

How can I made Cherno trader citys God Mode?


Link

Question

I've been searching around the forums but can't seem to find any solid threads that explain an updated method of making safe zones godmode zones, if somebody could explain or direct me to a reputable thread that method works that would be amazing

 

Thank you :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Here is a common safe zone script.

 

Step:1)Make a sqf file. Name it what ever you want. example safezone.sqf and place this code inside it. Place the safezone.sqf inside the root of your mission file.

Private ["_EH_Fired"];
     
    if (isNil "canbuild") then {
            canbuild = true;
    };
     
    while {true} do {
            waitUntil { !canbuild };
     
            waitUntil { player == vehicle player };
     
            thePlayer = vehicle player;
            _EH_Fired = thePlayer addEventHandler ["Fired", {
            titleText ["You Can Not Fire Your Weapon In A Safe Zone.","PLAIN DOWN"]; titleFadeOut 4;
            NearestObject [_this select 0,_this select 4] setPos[0,0,0];
            }];
     
            player_zombieCheck = {};
            fnc_usec_damageHandler = {};
            fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
            fnc_veh_handleDam = {};
	    fnc_veh_handleKilled = {};
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer addEventHandler ["handleDamage", {false}];
            thePlayer allowDamage false;
     
            waitUntil { canbuild };

            thePlayer removeEventHandler ["Fired", _EH_Fired];
     
            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";
	    fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
	    fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
            thePlayer addEventHandler ["handleDamage", {true}];
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer allowDamage true;
    };

Step:2)Open your mission.sqm inside your mission file. Under class sensors find the zone you want to be godmode/safe zone. We will use stary as a example. next to the expActiv= and expDesactiv= place this in that line

		class Item0
		{
			position[]={6325.6772,304.99033,7807.7412};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonestary";
			expCond="(player distance zonestary) < 100;";
			expActiv="canbuild = false;  titleText [""\n\nEntering Safe Zone. Weapons Deactivated."", ""PLAIN DOWN"", 1];";
			expDesactiv="canbuild = true;  titleText [""\n\nExiting Safe Zone. Weapons Activated."", ""PLAIN DOWN"", 1};";
			class Effects
			{
			};
		};

Step:3)Open your init.sqf and toward the bottom under the   if (!isDedicated) then {  call the safe zone like this

if (!isDedicated) then {
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");	
	
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	[] execVM "safezone.sqf";
};

All done. You can do this for every zone you want. Cheers...

Link to comment
Share on other sites

  • 0

Here is a common safe zone script.

 

Step:1)Make a sqf file. Name it what ever you want. example safezone.sqf and place this code inside it. Place the safezone.sqf inside the root of your mission file.

Private ["_EH_Fired"];
     
    if (isNil "canbuild") then {
            canbuild = true;
    };
     
    while {true} do {
            waitUntil { !canbuild };
     
            waitUntil { player == vehicle player };
     
            thePlayer = vehicle player;
            _EH_Fired = thePlayer addEventHandler ["Fired", {
            titleText ["You Can Not Fire Your Weapon In A Safe Zone.","PLAIN DOWN"]; titleFadeOut 4;
            NearestObject [_this select 0,_this select 4] setPos[0,0,0];
            }];
     
            player_zombieCheck = {};
            fnc_usec_damageHandler = {};
            fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
            fnc_veh_handleDam = {};
	    fnc_veh_handleKilled = {};
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer addEventHandler ["handleDamage", {false}];
            thePlayer allowDamage false;
     
            waitUntil { canbuild };

            thePlayer removeEventHandler ["Fired", _EH_Fired];
     
            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";
	    fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
	    fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
            thePlayer addEventHandler ["handleDamage", {true}];
            thePlayer removeAllEventHandlers "handleDamage";
            thePlayer allowDamage true;
    };

Step:2)Open your mission.sqm inside your mission file. Under class sensors find the zone you want to be godmode/safe zone. We will use stary as a example. next to the expActiv= and expDesactiv= place this in that line

		class Item0
		{
			position[]={6325.6772,304.99033,7807.7412};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonestary";
			expCond="(player distance zonestary) < 100;";
			expActiv="canbuild = false;  titleText [""\n\nEntering Safe Zone. Weapons Deactivated."", ""PLAIN DOWN"", 1];";
			expDesactiv="canbuild = true;  titleText [""\n\nExiting Safe Zone. Weapons Activated."", ""PLAIN DOWN"", 1};";
			class Effects
			{
			};
		};

Step:3)Open your init.sqf and toward the bottom under the   if (!isDedicated) then {  call the safe zone like this

if (!isDedicated) then {
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");	
	
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	[] execVM "safezone.sqf";
};

All done. You can do this for every zone you want. Cheers...

 

Thank you, very helpful! :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...