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

How to create a light
http://aghl.ru/forum/viewtopic.php?f=20&t=2496
Страница 1 из 2

Автор:  abdobiskra [ 29 июн 2016, 03:18 ]
Заголовок сообщения:  How to create a light

I want to create a light in some places off the map?
i do like that ?
Код:
#include <amxmodx>

public plugin_precache( )
{
    create_light( Float:{32.0, -320.0, -1784.0})
}

public create_light( Float:origin[3])
{
   
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    write_byte(TE_DLIGHT);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]);
    write_byte(100);//R
    write_byte(0);//r
    write_byte(0);//g
    write_byte(255);//b
    write_byte(150);//t
    write_byte(60);//decay *0.1s
    message_end();
       
    set_task(1.0, "create_light", 1)
       
    server_print("------------^nN1 = %.1f ^nN2 = %.1f ^nN3 = %.1f^n------------", origin[0], origin[1], origin[2])

}
but did not succeed!

What is the better way to achieve this?

Автор:  unnamed [ 01 июл 2016, 03:14 ]
Заголовок сообщения:  Re: How to create a light

origin should be integer

Автор:  Lev [ 01 июл 2016, 04:34 ]
Заголовок сообщения:  Re: How to create a light

No, it is right, it should be float.
Код:
static cell AMX_NATIVE_CALL ewrite_coord(AMX *amx, cell *params) /* 1 param */
{
   g_pEngTable->pfnWriteCoord(static_cast<float>(params[1]));

Автор:  abdobiskra [ 01 июл 2016, 04:48 ]
Заголовок сообщения:  Re: How to create a light

unnamed писал(а):
origin should be integer

The same results obtained by the light is in spawn world (like in crossfire sky spawn)
i tryed origin
Код:
create_light({-256, 704, -1808})
but the debug print
Цитата:
------------
N1 = -1056964609
N2 = -268435454
N3 = 16777208
------------

other map using the sam origin ?

Вложение:
ttttttttttt.JPG
ttttttttttt.JPG [ 57.19 КБ | Просмотров: 3586 ]

Автор:  unnamed [ 01 июл 2016, 23:50 ]
Заголовок сообщения:  Re: How to create a light

From my plugin:

Код:
      
        pev(player, pev_origin, origin)

   message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
   write_byte(TE_DLIGHT)
   write_coord(floatround(origin[0]))
   write_coord(floatround(origin[1]))
   write_coord(floatround(origin[2]))
   write_byte(35)
   write_byte(80)
   write_byte(255)
   write_byte(100)
   write_byte(80)
   write_byte(60)
   message_end()
   

It works well.
write_coord accept integer values

Автор:  abdobiskra [ 02 июл 2016, 08:52 ]
Заголовок сообщения:  Re: How to create a light

unnamed
I also get the same result between them

Цитата:
pev(player, ....

i think that's different?
i do not want to refer to index ?

Автор:  abdobiskra [ 05 июл 2016, 17:44 ]
Заголовок сообщения:  Re: How to create a light

Can I make the light in Texture ?
Texture = ent ?

Автор:  unnamed [ 06 июл 2016, 01:44 ]
Заголовок сообщения:  Re: How to create a light

abdobiskra писал(а):
Can I make the light in Texture ?
Texture = ent ?

No.
Texture != ent.

Автор:  abdobiskra [ 06 июл 2016, 03:03 ]
Заголовок сообщения:  Re: How to create a light

Oki!
I think I can not do that?
But there are those who did so in this video
https://youtu.be/qINyKHDywz4?t=62

Автор:  Lev [ 06 июл 2016, 04:08 ]
Заголовок сообщения:  Re: How to create a light

Red lights or white on the player?

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