Quote:
Originally Posted by edon1337
Anyone has managed to fix the spectator bug? I can't find anything related to this inside the plugins
Steps to re-produce:
1) Set your team to spectator (using an external plugin)
2) Use say chat (send a message)
3) Your team changes to T/CT
|
here comes a rather unpleasant thing
you can use an external plugin for transfer but not the team menu
in any case, the plugin will have to be compatible with csdm
so for any transfer we use csdm_respawn(index)
you can use something like this ( i didn't test it ):
Spoiler
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <csdm>
new Commands[][] =
{
"/spec",
"/ct",
"/t"
}
public plugin_init()
{
register_plugin("testing", "1.0", "Test");
register_clcmd("say", "hook_say");
}
public hook_say(id)
{
new arg[192];
read_args(arg, 31);
remove_quotes(arg);
for(new i = 0; i < sizeof Commands; i++)
{
if(equal(arg, Commands[i]))
{
switch(i)
{
case 0:
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return 1;
cs_set_user_team (id ,CS_TEAM_SPECTATOR);
user_silentkill (id);
}
case 1:
{
if(cs_get_user_team(id) == CS_TEAM_CT)
return 1;
cs_set_user_team(id ,CS_TEAM_CT);
if(is_user_alive(id))
user_silentkill (id);
csdm_respawn (id);
}
case 2:
{
if(cs_get_user_team(id) == CS_TEAM_T)
return 1;
cs_set_user_team(id,CS_TEAM_T);
if(is_user_alive(id))
user_silentkill (id);
csdm_respawn (id);
}
}
}
}
return 0;
}
the bug occurs when using the team menu and csdm
the only fix i found was to use an external plugin and block the team menu
if the team menu and the external plugin are used, a bug will appear when transferring players.
the bug is manifested by not displaying the player's target