Half-Life и Adrenaline Gamer форум

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

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




Начать новую тему Ответить на тему  [ Сообщений: 18 ]  На страницу 1, 2  След.
Автор Сообщение
 Заголовок сообщения: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 19 ноя 2017, 22:38 
Не в сети
Зарегистрирован:
19 ноя 2017, 18:58
Последнее посещение:
01 янв 2023, 02:59
Сообщения: 16
Hello everyone,
I would like to know if anyone has a plugin/could create a plugin that disables friendly fire and creates a shield around ally N.P.C.´s
just like the image in attachment from an op4 coop server shows.
I need this plugin to work with the Opposing Force Coop Addon and I searched many times for it but found nothing, so I presume
that is only available on that specific server.
I would like to know if anyone could help me.


Вложения:
of2a30002.jpg
of2a30002.jpg [ 296.27 КБ | Просмотров: 4920 ]
Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 21 ноя 2017, 21:53 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
Hi!
Probably you will need someone that will be interested in writing such plugin.
Could be easier if you will be able to find such plugins for CS (something like NPC protection).
The main task, probably, will be to determine which NPC is ally and which isn't.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 22 ноя 2017, 01:35 
Не в сети
Зарегистрирован:
19 ноя 2017, 18:58
Последнее посещение:
01 янв 2023, 02:59
Сообщения: 16
Yeah, you're right, I have already searched and found some plugins similar to this one like "Hostage Protection 1.8" for CS
and "Damage Render TDM" that is almost the plugin that I am looking for but it is for Half-Life TDM and it creates a
shield around players on your team when you try to damage them.
Unfortunatly I don't know any scripter intersted in wtriting the plugin, but thanks anyways for your answer.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 22 ноя 2017, 02:00 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
Probably I could help with ally NPC detection code.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 23 ноя 2017, 23:43 
Не в сети
Зарегистрирован:
19 ноя 2017, 18:58
Последнее посещение:
01 янв 2023, 02:59
Сообщения: 16
That seems to be a good start but I'm not good at scripting so the thing is that I don't know what to do next...
Maybe we could use some parts of code from "Damage Render TDM" but change the ID of players to the Ally N.P.C.'s,
or I'm just being very dumb.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 24 ноя 2017, 02:37 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
Attach them here. Probably, if they are not large I can figure something out.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 25 ноя 2017, 02:23 
Не в сети
Зарегистрирован:
19 ноя 2017, 18:58
Последнее посещение:
01 янв 2023, 02:59
Сообщения: 16
Im' not sure but I think that this part contains some important stuff.

Код:
public plugin_init(){
   register_plugin("Damage Render TDM","0.4","GordonFreeman")
   
   register_cvar("damage_render_tdm","0.4",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
   
   register_cvar("drtdm_sound","1")
   register_cvar("drtdm_particle","1")
   
   g_maxplayers = get_maxplayers()
}

public plugin_cfg(){
   // stop plugin, if there is not tdm with no ff
   if(!(get_cvar_num("mp_teamplay")&&!get_cvar_num("mp_friendlyfire")))
      pause("ac","Damage Render TDM")
   
   // register ham hooks
   RegisterHam(Ham_TraceAttack,"player","player_traceattack")   // for fire style weapons (block blood)
   RegisterHam(Ham_TakeDamage,"player","player_takedamage")   // for entity based weapons
   
   sound = get_cvar_num("drtdm_sound")
   aparticle = get_cvar_num("drtdm_particle")
}

public player_traceattack(victim,inflictor){
   if(!(0<inflictor<=g_maxplayers))
      return HAM_IGNORED
   
   // check teams
   if(get_user_team(inflictor)!=get_user_team(victim))
      return HAM_IGNORED
   
   // show effects
   remove_task(victim)            // reset
   update_PlayerRender(victim,inflictor,1)      // render
   set_task(0.5,"remove_PlayerRender",victim)   // reset render
      
   return HAM_SUPERCEDE            // block blood
}

public player_takedamage(victim,inflictor,attacker){
   if(!(0<attacker<=g_maxplayers))
      return HAM_IGNORED
      
   if(get_user_team(attacker)!=get_user_team(victim)||victim==attacker)
      return HAM_IGNORED
   
   remove_task(victim)
   update_PlayerRender(victim,attacker,1)
   set_task(0.5,"remove_PlayerRender",victim)
      
   return HAM_SUPERCEDE
}

public remove_PlayerRender(id)
   if(pev_valid(id))
      update_PlayerRender(id,0,0)

public update_PlayerRender(id,attacker,renderstyle){
   if(!renderstyle){
      fm_set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,0)
      
      return PLUGIN_CONTINUE
   }
   
   static color[3],origin[3]
   
   get_user_origin(id,origin)
   
   switch(get_user_team(id)){
      case 1: color = {80,80,255}
      case 2: color = {255,80,80}
      case 3: color = {200,200,80}
      case 4: color = {80,200,80}
      default: color = {0,0,0}
   }
   


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 28 ноя 2017, 05:20 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
26 мар 2024, 21:42
Сообщения: 6864
If I am not wrong player_traceattack and player_takedamage will not help in that case.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 30 ноя 2017, 00:22 
Не в сети
Зарегистрирован:
19 ноя 2017, 18:58
Последнее посещение:
01 янв 2023, 02:59
Сообщения: 16
So what should I do?
Maybe you know GordonFreeman (serfreeman1337), I think he also had a hl op4 coop server with that plugin,
perhaps he could help with this.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: OP4 Coop Ally N.P.C.'s protect
СообщениеДобавлено: 30 дек 2017, 04:28 
Не в сети
Аватара пользователя
Зарегистрирован:
30 дек 2013, 23:30
Последнее посещение:
21 мар 2024, 21:08
Сообщения: 11
viewtopic.php?f=28&t=1725

_________________
Bulgarian Half-Life Community hlbgc.ucoz.com
ИзображениеИзображение


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

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


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

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 6


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

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