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
  • 0
Sign in to follow this  
kkac9kk

Данные по сурвивору

Подскажите пжл. как можно вытащить данные по сурвивору.

Необходимо получить дистанцию пройденную персонажем.

У меня идет вычленение человека которого убили и я хочу узнать сколько убитый прошел метров до смерти и сравнить их с n-ным кол-вом метров.

Как пример: у меня есть скрипт который выдает определенный предмет при убийстве другого игрока, но для того что бы не убивали кепок я хочу чтоб убитый прошел 5км и ток потом за него пойдет зачет кила.

Нашел только статистику по персонажу до смерти которая заворачивается в date но как определенного человека достать хз.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
modded class PlayerBase
{
	float m_Tick = 0;
	float m_DistanceTravelled;
	vector m_LastPosition;
	override void OnInit()
	{
		super.OnInit();
		m_DistanceTravelled = 0;
		m_LastPosition = GetPosition();
	}
	
	override void OnScheduledTick(float deltaTime)
	{
		super.OnScheduledTick(deltaTime);
		m_Tick += deltaTime;
		if (m_Tick => 3) //Prevents server from fps dropping
		{
			m_Tick = 0;
			m_DistanceTravelled = vector.Distance(m_LastPosition, GetPosition());
			m_LastPosition = GetPosition();
		}
	}
	
	override void EEKilled( Object killer )
	{
		super.EEKilled(killer);
		if (m_DistanceTravelled >= 5000
		{
			//Делаем что-то      
		}
	}
}

 

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
Sign in to follow this  

×
×
  • 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.