Jump to content
Sign in to follow this  
epicgoldenwarrior

Suppression script

Recommended Posts

wo speling.

Hey guys, have a script here that doesnt work.

_this addEventHandler ["FiredNear",
{
   if ((_this select 2) < 2) then
   {
    "dynamicBlur" ppEffectEnable true; // enables ppeffect
    "dynamicBlur" ppEffectAdjust [5]; // intensity of blur
    "dynamicBlur" ppEffectCommit 0.2; // time till vision is fully blurred
    sleep 5;
    "dynamicBlur" ppEffectEnable true; // enables ppeffect
    "dynamicBlur" ppEffectAdjust [0]; // enables normal vision
    "dynamicBlur" ppEffectCommit 1; // time it takes to normal
   };
   if ((_this select 2) < 5) then
   {
   enableCamShake true;	// enables camera shake
   addCamShake [10, 45, 10];	// sets shakevalues
   sleep 4; 
   resetCamShake; // resets the shake
   };
}];

Asked austin_medic for help but we're stumped.

This is a small part of a different script so, make sure it works with other stuff(?).

Share this post


Link to post
Share on other sites

EventHandler code is run non scheduled so you can not sleep in it. You will have to spawn your code e.g...

_this addEventHandler ["FiredNear",
{
h = _this spawn {

	if ((_this select 2) < 2) then
	{
		 "dynamicBlur" ppEffectEnable true;
		 "dynamicBlur" ppEffectAdjust [5];
		 "dynamicBlur" ppEffectCommit 0.2;
		 sleep 5;
		 "dynamicBlur" ppEffectEnable true;
		 "dynamicBlur" ppEffectAdjust [0];
		 "dynamicBlur" ppEffectCommit 1;
	};
	if ((_this select 2) < 5) then
	{
		enableCamShake true;
		addCamShake [10, 45, 10];
		sleep 4; 
		resetCamShake;
	};
};
}];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×