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

replace decal player
http://econ.aghl.ru/forum/viewtopic.php?f=12&t=2775
Страница 2 из 3

Автор:  abdobiskra [ 16 сен 2017, 16:28 ]
Заголовок сообщения:  Re: replace decal player

Lev писал(а):
Only the question will be "replacing with what?"
replace decal player with
abdobiskra писал(а):
// 26 = "{biohaz" decal
Вложение:
{biohaz.JPG
{biohaz.JPG [ 9.11 КБ | Просмотров: 2048 ]

Автор:  Lev [ 16 сен 2017, 19:02 ]
Заголовок сообщения:  Re: replace decal player

I dunno if it is (needs to be) precached, so you have to check yourself.

Автор:  abdobiskra [ 16 сен 2017, 19:35 ]
Заголовок сообщения:  Re: replace decal player

Yes I tried it before but without results :unknown:
Код:
#include < amxmodx >
#include <fakemeta>

new decal

public plugin_init( )
   register_message( SVC_TEMPENTITY, "ReplaceTempEntity" );

/*public plugin_cfg()
{
   decal = engfunc(EngFunc_DecalIndex, "{biohaz" )
}*/
public plugin_precache()
{
   decal = engfunc(EngFunc_DecalIndex, 26 )
}
public ReplaceTempEntity( )
{
   if( get_msg_arg_int(1) == TE_PLAYERDECAL  )
      set_msg_arg_int( 7, get_msg_argtype( 7 ), decal );// 26 = "{biohaz" decal
}
I think I found a solution here that needs to be tested
 

Автор:  Lev [ 17 сен 2017, 01:31 ]
Заголовок сообщения:  Re: replace decal player

EngFunc_DecalIndex accepts a string.
Код:
decal = engfunc(EngFunc_DecalIndex, "{biohaz" )
this was right.
Also, you should check what it returns. And decal 26 isn't a biohaz, but DECAL_GLASSBREAK2 (from HLSDK).
So, you need to check what you do.

Автор:  abdobiskra [ 17 сен 2017, 18:59 ]
Заголовок сообщения:  Re: replace decal player

However, the same problem remains
Lev писал(а):
EngFunc_DecalIndex accepts a string.
I thought that when i set the message it should be a int value

Lev писал(а):
Also, you should check what it returns.

I think that's right here?
Код:
#include < amxmodx >
#include <fakemeta>

new decal

public plugin_init( )
   register_message( SVC_TEMPENTITY, "ReplaceTempEntity" );

/*public plugin_cfg()
{
   decal = engfunc(EngFunc_DecalIndex, "{biohaz" )
}*/
public plugin_precache()
{
   decal = engfunc(EngFunc_DecalIndex, "{biohaz" )
}
public ReplaceTempEntity( )
{
   
   if( get_msg_arg_int(1) == TE_PLAYERDECAL  )
   {
      set_msg_arg_int( 7, get_msg_argtype( 7 ), decal );
      return 1
   }
   return 0
   
}

Автор:  Lev [ 17 сен 2017, 19:20 ]
Заголовок сообщения:  Re: replace decal player

It is right based on functions, etc. But not sure about will it display that decal or no. You should check yourself. And, debug decal value. It will be higher than you think.

Автор:  abdobiskra [ 17 сен 2017, 20:35 ]
Заголовок сообщения:  Re: replace decal player

Lev писал(а):
debug decal value
print :
Код:
client_print(0, print_chat, "decal : %i", decal)
result :
Цитата:
decal : 26
Nothing appears but the sound is heard (spray sound)

Автор:  Lev [ 18 сен 2017, 14:38 ]
Заголовок сообщения:  Re: replace decal player

I see. On my server it was 129.

Автор:  abdobiskra [ 18 сен 2017, 16:46 ]
Заголовок сообщения:  Re: replace decal player

in windows :
Цитата:
decal : 26
when i try on linux i see :
Цитата:
decal : 195

Автор:  Lev [ 19 сен 2017, 03:53 ]
Заголовок сообщения:  Re: replace decal player

It should be normal, because of different precache orders (also depends on map).
But, I dunno if it ok to use these in player decals.

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