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

Spectator mod ?
http://econ.aghl.ru/forum/viewtopic.php?f=12&t=2620
Страница 3 из 5

Автор:  abdobiskra [ 18 янв 2017, 21:15 ]
Заголовок сообщения:  Re: Spectator mod ?

Yes i tested (0 / 1) the same result !
 

this after reconnect

Вложение:
20170118161517_1.jpg
20170118161517_1.jpg [ 136.38 КБ | Просмотров: 3879 ]


this after reconnect and spawned :

Вложение:
20170118162201_1.jpg
20170118162201_1.jpg [ 126.48 КБ | Просмотров: 3879 ]


players alive in all image result

Автор:  Lev [ 18 янв 2017, 22:02 ]
Заголовок сообщения:  Re: Spectator mod ?

Ok, yes, the problem exists if client is just started (HUD never initialized). Not sure what leads to that. I think HUD reset and init messages do not arrive to the client if toggle to spectator happen in putinserver. Dunno if that is AMXX or engine problem.
So, here is workaround that works:
Код:
#include <amxmisc>
#include <hl>

public plugin_init()
{
   register_plugin("Test", "0.0", "Lev");
}
public client_putinserver(id)
{
   set_task(0.1, "toggle1", id);
}
public toggle1(id)
{
   hl_set_user_spectator(id, true);
   set_task(10.0, "toggle2", id);
}
public toggle2(id)
{
   hl_set_user_spectator(id, false);
}
Players will spawn for the moment if mp_welcomcam is 0, but you can leave it at 1.
Don't forget to add various checks like, is_connected, etc...

Автор:  abdobiskra [ 18 янв 2017, 22:16 ]
Заголовок сообщения:  Re: Spectator mod ?

OK TY FOR YOUR CARING
I think I found another way :
but i need stoped the Ham_spawn function in first spawn (so i need to first spawn only worked this Ham_Spawn)
how i can stoped it ?

Автор:  Lev [ 18 янв 2017, 22:23 ]
Заголовок сообщения:  Re: Spectator mod ?

I don't understand you. You saying that you found the way, but other text says that you can't go with that, because you are facing some wall.

Автор:  abdobiskra [ 18 янв 2017, 22:30 ]
Заголовок сообщения:  Re: Spectator mod ?

Unfortunately, but now only come to understand :)

Ps:
ah! i tested your code also its work perfectly now :shock:
the problem in set_task need to set in function client_putinserver :Bravo:
Thank you very much Leo
Solved!

Автор:  abdobiskra [ 21 фев 2017, 16:23 ]
Заголовок сообщения:  Re: Spectator mod ?

Hi again and sorry for opening this tpc again
bcz i found other problem idk if you can understand me !
when player connected in first connect and set it in spectator and other players play ( this last! mean other players alive )
and when change the map & It is still in the spectator
he cant spawn in new round never?

Автор:  Lev [ 21 фев 2017, 19:45 ]
Заголовок сообщения:  Re: Spectator mod ?

Dunno. Restarting the server should reset all, so I see no reason for that.

Автор:  abdobiskra [ 21 фев 2017, 19:51 ]
Заголовок сообщения:  Re: Spectator mod ?

me also did not cause obvious age of the problem and even if I have to restart the server remains the same problem!

Вложения:
Скачать плагин или Скачать исходник [hlround.sma - 10.04 КБ]
Скачиваний: 416

Автор:  Lev [ 21 фев 2017, 22:07 ]
Заголовок сообщения:  Re: Spectator mod ?

Код:
public client_disconnect(id)
{
   hl_set_user_spectator(id, false);
No need for this action.

I didn't got the problem completely. Too short description.
Also, you can try to do debug printing in the plugin to get know if this is your code put players into spectate.

Автор:  abdobiskra [ 22 фев 2017, 02:29 ]
Заголовок сообщения:  Re: Spectator mod ?

Lev писал(а):
Код:
public client_disconnect(id)
{
   hl_set_user_spectator(id, false);
No need for this action.
Yes I try some of the things i forget it :)
Lev писал(а):
I didn't got the problem completely. Too short description.
maybe not been tried with other players because if you tried it on your self the problem will not occur ?
here short video myb explaind better :

Lev писал(а):
Also, you can try to do debug printing in the plugin to get know if this is your code put players into spectate.
Yes i try that now and i did not get the print msg in this problem ?

Вложения:
Скачать плагин или Скачать исходник [hl_round.sma - 10.43 КБ]
Скачиваний: 433

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