Half-Life и Adrenaline Gamer форум

Всё об игре в Халф-Лайф и АГ
Текущее время: 29 мар 2024, 02:55

Часовой пояс: UTC + 5 часов [ Летнее время ]




Начать новую тему Ответить на тему  [ Сообщений: 13 ]  На страницу Пред.  1, 2
Автор Сообщение
 Заголовок сообщения: Re: how i can restart spawn stuff of the map ?
СообщениеДобавлено: 08 июл 2018, 15:38 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
rtxa
That is because game dll deal differently with weapons as you think. When player pickups a weapon, that exactly weapon entity is attached to a player and another weapon is created and laid down on the floor invisible. So, when you wish to do an instant respawn, you should at that time enumerate all entities, find weapons that are invisible and don't follow players
Код:
(pev->effects & EF_NODRAW) != 0 && pev->movetype != MOVETYPE_FOLLOW
and reset their think time
Код:
set_pev(i, pev_nextthink, get_gametime());


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: how i can restart spawn stuff of the map ?
СообщениеДобавлено: 09 июл 2018, 08:34 
Не в сети
Зарегистрирован:
24 апр 2017, 21:16
Последнее посещение:
19 ноя 2023, 09:01
Сообщения: 53
abdobiskra писал(а):
rtxa писал(а):
but with weapons doesn't work. Any ideas?
Some thing like this :
Код:
public plugin_init()
   register_touch(Your_Weapon_List[],"worldspawn","Next_Think")

public Next_Think(weapon)
   set_pev(weapon,pev_nextthink,get_gametime() + 5.0)) return weapon //5sec to respawn
Thank for answering, but isn't what I'm looking for, because that only work when you touch the weapon, i need to respawn it at any moment.
Lev писал(а):
rtxa
That is because game dll deal differently with weapons as you think. When player pickups a weapon, that exactly weapon entity is attached to a player and another weapon is created and laid down on the floor invisible. So, when you wish to do an instant respawn, you should at that time enumerate all entities, find weapons that are invisible and don't follow players
Код:
(pev->effects & EF_NODRAW) != 0 && pev->movetype != MOVETYPE_FOLLOW
and reset their think time
Код:
set_pev(i, pev_nextthink, get_gametime());
Ok Lev, but that is just a filter, setting pev_nexthink to get_gametime() to all entities should make them respawn but it doesn't.

_________________
Изображение
Zombie Mod X | AG Mod X | HL Player Models API
Contact:
@Discord: rtxa#6795


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: how i can restart spawn stuff of the map ?
СообщениеДобавлено: 13 июл 2018, 22:23 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
rtxa
Lev писал(а):
when you wish to do an instant respawn, you should at that time enumerate all entities
You didn't.


Вернуться к началу
 Профиль 
  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 13 ]  На страницу Пред.  1, 2

Часовой пояс: UTC + 5 часов [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: Bing [Bot] и гости: 6


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Создано на основе phpBB® Forum Software © phpBB Group
Русская поддержка phpBB