Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
Melnikov

Активация аномалий по таймеру

Recommended Posts

Posted (edited)

Ку! Выкладываю скрипт, который позволяет спавнить аномалии по таймеру, т.е. Аномалия спавнится, срабатывает и исчезает и так циклично. 
Для данного скрипта, требуется мод на аномалии, абсолютно любой, то-ли от Совы, либо от Никрона, используйте любые, будет работать...
Заливать в мод, не требуется!
Что-бы скрипт заработал, в Init.c нужно добавить строку, в самом начале:
 

#include "$CurrentDir:mpmissions\Dayz.ExclusionZone\AnomalyElectraTimer.c"

Сам скрипт:
 

ref AnomalyElectraTimer m_AnomalyElectraTimer = new AnomalyElectraTimer();

class AnomalyElectraTimer
{
	ref TVectorArray positions = {
		"(Координата без запятых)" //Просто вставь координату, в формате "X Y Z", Если координат много то: "X Y Z", "X Y Z" и т.д.
	};
	
	ref array<EntityAI>	objects = new array<EntityAI>;

    void AnomalyElectraTimer()
    {
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.AnomalyTimer, 1 * 1000, true)
		GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(this.AnomalyTimerClear, 60 * 1000, true);
    }

    void AnomalyTimerClear()
    {
		for (private int i = 0; i < objects.Count(); i++)
		{
			GetGame().ObjectDelete(objects[i]);
		}
		objects.Clear();
    }

    void AnomalyTimer()
    {
		objects.Insert(GetGame().CreateObject("(Название аномалии)", positions[Math.RandomInt(0, positions.Count() - 1)])); //Название аномалии должно быть с припиской Active, пример: "Electra_Active"
    }
}

 

Edited by Melnikov (see edit history)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.