Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

how i can restart spawn stuff of the map ?
http://aghl.ru/forum/viewtopic.php?f=12&t=2672
Страница 2 из 2

Автор:  Lev [ 08 июл 2018, 15:38 ]
Заголовок сообщения:  Re: how i can restart spawn stuff of the map ?

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());

Автор:  rtxa [ 09 июл 2018, 08:34 ]
Заголовок сообщения:  Re: how i can restart spawn stuff of the map ?

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.

Автор:  Lev [ 13 июл 2018, 22:23 ]
Заголовок сообщения:  Re: how i can restart spawn stuff of the map ?

rtxa
Lev писал(а):
when you wish to do an instant respawn, you should at that time enumerate all entities
You didn't.

Страница 2 из 2 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/