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

check entity kill players (worldspawn)
http://aghl.ru/forum/viewtopic.php?f=12&t=2862
Страница 1 из 1

Автор:  abdobiskra [ 25 янв 2018, 02:51 ]
Заголовок сообщения:  check entity kill players (worldspawn)

Hello!
there many entity in maps when killed the players will write that player (killed self with worldspawn) like water for example.
the question is how to make it a private classname .. like othere (ex: trigger_hurt)

Автор:  Lev [ 25 янв 2018, 16:42 ]
Заголовок сообщения:  Re: cheak entity kill players (worldspawn)

Hook DeathMsg and replace weapon name with whatever you want.

Автор:  abdobiskra [ 25 янв 2018, 16:56 ]
Заголовок сообщения:  Re: cheak entity kill players (worldspawn)

What if it was not what I was looking for (ex : fall dmg or othere.. there many entity has this weapon "worldspawn" Not knowing)
i try to hook it using pfn function :
Код:
public pfn_keyvalue( iEntity ) {
   new szClassName[ 22 ], szKeyName[ 17 ], szValue[ 17 ];
   copy_keyvalue( szClassName, 21, szKeyName, 16, szValue, 16 );

   if( equal( szClassName, "func_water" )/* && equal(szKeyName,"targetname") &&  equal(szValue,"bigwater")*/) {
      new iNew = create_entity( "trigger_hurt" );// myb it should trigger_push ?
      
      //DispatchKeyValue( iNew, "dmg", "10" );
      //DispatchKeyValue( iNew, "damagetype", "524288" ); //524288 = DROWNRECOVER<BR>  | 16384 = DROWN<BR>
      DispatchKeyValue( iNew, szKeyName, szValue );
      DispatchSpawn( iNew );
      server_print("===================== %s : %s ===================", szKeyName, szValue)
      entity_set_string( iNew, EV_SZ_classname, szClassName );
   }
}
}

This is exactly the idea I got the weapon is water when i enable dmg entity (iNew) else no results..
how i can make everything default and change this name of weapon "worldspawn"

here setting in the map undertow :
 

Автор:  Lev [ 25 янв 2018, 18:13 ]
Заголовок сообщения:  Re: cheak entity kill players (worldspawn)

I dunno what you are doing and what you want to achieve.

Автор:  abdobiskra [ 25 янв 2018, 18:34 ]
Заголовок сообщения:  Re: check entity kill players (worldspawn)

The general idea is that :
I want to determine that the player died drowning in the water
but in the game said "Player killed self with worldspawn"
I want to replace the name of the weapon here to water "Player killed self with water"
is that possible ?

Автор:  Lev [ 25 янв 2018, 19:04 ]
Заголовок сообщения:  Re: check entity kill players (worldspawn)

Sure, but you didn't specified where you want to replace that text. In client console?

Автор:  abdobiskra [ 25 янв 2018, 20:29 ]
Заголовок сообщения:  Re: check entity kill players (worldspawn)

Yeah, i want make water entity ID .. for use in other areas when needed.

Автор:  Lev [ 25 янв 2018, 21:18 ]
Заголовок сообщения:  Re: check entity kill players (worldspawn)

abdobiskra писал(а):
i want make water entity ID
Woot? As usual, I don't understand you. :D

abdobiskra писал(а):
I want to replace the name of the weapon
Hook player TakeDamage, check pevAttacker (second argument), if not player, store pevInflictor (first argument) globally, if player, clear global variable.
Hook player Killed, if pevInflictor is filled, then it is not player killed player and classname of killer entity (pevInflictor) will be used to form the message string. So you can change classname here to what ever you want and then change it back (in post hook).

Автор:  abdobiskra [ 25 янв 2018, 21:56 ]
Заголовок сообщения:  Re: check entity kill players (worldspawn)

Lev писал(а):
Woot? As usual, I don't understand you. :D
Yeah, its google + my R.I.P Eng = another language :crazy:
myb it should be :
i want make for water entity ID (This is what I mean by giving a name to the entity that is the water)
Lev писал(а):
abdobiskra писал(а):
I want to replace the name of the weapon
Hook player TakeDamage, check pevAttacker (second argument), if not player, store pevInflictor (first argument) globally, if player, clear global variable.
Hook player Killed, if pevInflictor is filled, then it is not player killed player and classname of killer entity (pevInflictor) will be used to form the message string. So you can change classname here to what ever you want and then change it back (in post hook).
Yes, I will try one of them.

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