Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies and more


Tutorial [ Adding earthquake in server]


Surama

Recommended Posts

In this tuto i show u how u can easy add earthquake in u'r server...

Earthquake have't damage

 

U need:

 

1) mission.pbo

2) Notepad

 

1st step

-----------

Unpuck u'r mission pbo, and in root create a new SQF file, likes - earthquake.sqf

 

put this code in u'r earthquake.sqf

 

earth = {
playsound "eq";
for "_i" from 0 to 140 do {
_vx = vectorup _this select 0;
_vy = vectorup _this select 1;
_vz = vectorup _this select 2;
_coef = 0.01 - (0.0001 * _i);
_this setvectorup [
_vx+(-_coef+random (2*_coef)),
_vy+(-_coef+random (2*_coef)),
_vz+(-_coef+random (2*_coef))
];
sleep (0.01 + random 0.01);
};

};

while {true} do {
player spawn earth;
sleep (360 + random 30);
};

 

2-nd step

-------------------

 

In u'r INIT.sqf file find:

 

//Run the player monitor

_id = player addEventHandler ["Respawn", {_id = [] spawn player_death; _nul = [] execVM "playerspawn.sqf";}];
_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";

 

 

And below that add code:

 

null = [] execVM "earthquake.sqf";

 

------------------------------------------------------

 

changing these parameters "sleep (360 + random 30);" [in u'r earthquake.sqf file] - you can increase \reduce time of a dream and intensity...

 

------------------------------------------------------

 

DONE!

Pack u'r mission file, upload it to server!

Share this post


Link to post
Share on other sites

In this tuto i show u how u can easy add earthquake in u'r server...

Earthquake have't damage

 

U need:

 

1) mission.pbo

2) Notepad

 

1st step

-----------

Unpuck u'r mission pbo, and in root create a new SQF file, likes - earthquake.sqf

 

put this code in u'r earthquake.sqf

 

earth = {
playsound "eq";
for "_i" from 0 to 140 do {
_vx = vectorup _this select 0;
_vy = vectorup _this select 1;
_vz = vectorup _this select 2;
_coef = 0.01 - (0.0001 * _i);
_this setvectorup [
_vx+(-_coef+random (2*_coef)),
_vy+(-_coef+random (2*_coef)),
_vz+(-_coef+random (2*_coef))
];
sleep (0.01 + random 0.01);
};

};

while {true} do {
player spawn earth;
sleep (360 + random 30);
};

 

2-nd step

-------------------

 

In u'r INIT.sqf file find:

 

//Run the player monitor

_id = player addEventHandler ["Respawn", {_id = [] spawn player_death; _nul = [] execVM "playerspawn.sqf";}];
_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";

 

 

And below that add code:

 

null = [] execVM "earthquake.sqf";

 

------------------------------------------------------

 

changing these parameters "sleep (360 + random 30);" [in u'r earthquake.sqf file] - you can increase \reduce time of a dream and intensity...

 

------------------------------------------------------

 

DONE!

Pack u'r mission file, upload it to server!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...