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

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

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

Код:
   for(new i=1;i<=get_playersnum();++i){
Should be new i = 0;

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

thx Lev my eyes have opened again :D
i try other way and its work fine for me

Код:
   new players[32],pnum
   get_players(players,pnum)
bcz this cod up give me only msg print when i set it i = 0 and dont work to spawn players in this bug !

Автор:  rtxa [ 26 фев 2019, 05:46 ]
Заголовок сообщения:  Re: Spectator mod ?

Lev писал(а):
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.
Lev, I have trace the function where the problem begins, it's caused by RemoveAllItems(), don't know exactly why, but if you remove this, then the issues with scoreboard are gone when you set user spectator in putinserver.
Код:
void CBasePlayer::StartObserver( void )
{
   // clear any clientside entities attached to this player
   MESSAGE_BEGIN(MSG_PAS, SVC_TEMPENTITY, pev->origin);
      WRITE_BYTE(TE_KILLPLAYERATTACHMENTS);
      WRITE_BYTE(ENTINDEX(edict()));   // index number of primary entity
   MESSAGE_END();

   // Let's go of tanks
   if (m_pTank != NULL)
      m_pTank->Use(this, this, USE_OFF, 0);

   // Remove all the player's stuff
   RemoveAllItems(FALSE);

Автор:  Lev [ 20 мар 2019, 01:37 ]
Заголовок сообщения:  Re: Spectator mod ?

Honestly can't recall what the problem was. :D
Do you suggest just not to call RemoveAllItems when function is called from PutInServer?

Автор:  rtxa [ 20 мар 2019, 23:05 ]
Заголовок сообщения:  Re: Spectator mod ?

Lev писал(а):
Honestly can't recall what the problem was. :D
Do you suggest just not to call RemoveAllItems when function is called from PutInServer?
I was wrong, removing that in server DLL didn't change anything (besides not taking out weapons), but in my implementation for AMX Mod X, it works fine (there is a little movement lag), anyway, I notice that BOTS are not valid in client_putinserver(), so you still have to use a task of 0.1 or set it in the function where they start to be valid...
Код:
set_user_spectator(id)
{
   // this is the cause of scoreboard issues in putinserver
   //hl_strip_user_weapons(id);

   // setup flags
   set_ent_data(id, "CBasePlayer", "m_iHideHUD", HIDEHUD_WEAPONS | HIDEHUD_HEALTH);
   set_ent_data(id, "CBasePlayer", "m_afPhysicsFlags", get_ent_data(id, "CBasePlayer", "m_afPhysicsFlags") | PFLAG_OBSERVER);
   set_pev(id, pev_effects, EF_NODRAW);
   set_pev(id, pev_view_ofs, Float:{0.0, 0.0, 0.0});
   set_pev(id, pev_solid, SOLID_NOT);
   set_pev(id, pev_takedamage, DAMAGE_NO);
   set_pev(id, pev_movetype, MOVETYPE_NONE);
   set_ent_data(id, "CBasePlayer", "m_afPhysicsFlags", get_ent_data(id, "CBasePlayer", "m_afPhysicsFlags") & ~PFLAG_DUCKING);
   set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_DUCKING);
   set_pev(id, pev_deadflag, DEAD_RESPAWNABLE);
   set_pev(id, pev_health, 1);

   set_ent_data(id, "CBasePlayer", "m_fInitHUD", true);

   set_ent_data_float(id, "CBasePlayer", "m_flNextObserverInput", 0.0);
   set_pev(id, pev_iuser1, OBS_ROAMING);

   static TeamInfo;
   if (TeamInfo || (TeamInfo = get_user_msgid("TeamInfo")))
   {
      message_begin(MSG_ALL, TeamInfo);
      write_byte(id);
      write_string("");
      message_end();
   }

   static Spectator;
   if (Spectator || (Spectator = get_user_msgid("Spectator"))) {
      message_begin(MSG_ALL, Spectator);
      write_byte(id);
      write_byte(1);
      message_end();
   }
}
Maybe I have track the issue in InitHUD, from StartObserver->RemoveAllItems->UpdateClientData->InitHUD, I notice that it never calls SendMOTDToClient.
https://github.com/LevShisterov/Bugfixe ... s.cpp#L509

Автор:  Lev [ 02 апр 2019, 01:58 ]
Заголовок сообщения:  Re: Spectator mod ?

I suppose MOTD shouldn't be related to bugs in Score Panel.
BTW Do you testing on BugfixedHL client.dll? I think I fixed some Score Panel bugs there.

Автор:  rtxa [ 02 апр 2019, 06:34 ]
Заголовок сообщения:  Re: Spectator mod ?

Lev писал(а):
I suppose MOTD shouldn't be related to bugs in Score Panel.
BTW Do you testing on BugfixedHL client.dll? I think I fixed some Score Panel bugs there.
Yes I do, but I'm afraid the problem is from server-side, somethings is blocking it, (maybe InitHUD). You can manage to send yourself the messages to the player to soften the issue (GameTitle, TeamInfo, etc), but right now the problem I had is that you can't send bots to spectator, at least in putinserver. It doesn't work with "spectate" and it doens't work with my implementation (Invalid Private Data), also you can't block their spawn. I use RCBOT, but as far I remember, this also happens with JKBotti.

Автор:  Lev [ 03 апр 2019, 00:08 ]
Заголовок сообщения:  Re: Spectator mod ?

If you can give some test plugin to reproduce the issue with JKBotti I can take a look at it.

Автор:  rtxa [ 03 апр 2019, 04:08 ]
Заголовок сообщения:  Re: Spectator mod ?

For spectator issue:
 

For spawn blocking
Код:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
    RegisterHam(Ham_Spawn, "player", "PlayerSpawnPre")
}

public PlayerSpawnPre(id) {
    return is_user_bot(id) ? HAM_SUPERCEDE : HAM_IGNORED;
}

Автор:  rtxa [ 18 апр 2019, 20:26 ]
Заголовок сообщения:  Re: Spectator mod ?

You can just trigger the bug by calling UpdateClientData() in putinserver
Код:
public client_putinserver(id) {
    ExecuteHamB(Ham_Player_UpdateClientData, id);
}

Изображение

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