AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spectator -> CT or T bug (https://forums.alliedmods.net/showthread.php?t=341433)

Hardix 01-22-2023 06:07

Spectator -> CT or T bug
 
Hello,

I don't know if it's a bug or is just a CS 1.6 thingy but when I connect to server and choose the Spectator Team and I want to move to another team from a command (amx_t or amx_ct) I can't see the HUD and I see only the weapon.

AMX Mod X version 1.9.0.5294, I tried AMX Mod X version 1.8.3 and 1.10 too, same result
Video: https://www.youtube.com/watch?v=UOtQeW_jJoY
Code:
PHP Code:

public cmd_spec(id,level,cid)
{
    if(!
cmd_access(idlevelcid1))
    {
        return 
PLUGIN_HANDLED;
    }

    new 
arg[32], target;
    
read_argv(1arg31);
    
target cmd_target(idargCMDTARGET_NO_BOTS);
    if(!
target) return PLUGIN_HANDLED;

    new 
name[32], targetname[32];
    
get_user_name(idname31);
    
get_user_name(targettargetname31);
    if(
is_user_alive(target))
    
user_silentkill(target);
    
cs_set_user_team(targetCS_TEAM_SPECTATOR);

    return 
PLUGIN_HANDLED;
}

public 
cmd_t(id,level,cid)
{
    if(!
cmd_access(idlevelcid1))
    {
        return 
PLUGIN_HANDLED;
    }

    new 
arg[32], target;
    
read_argv(1arg31);
    
target cmd_target(idargCMDTARGET_NO_BOTS);
    if(!
target) return PLUGIN_HANDLED;

    new 
name[32], targetname[32];
    
get_user_name(idname31);
    
get_user_name(targettargetname31);
    if(
is_user_alive(target))
    
user_silentkill(target);
    
cs_set_user_team(targetCS_TEAM_T);

    return 
PLUGIN_HANDLED;
}

public 
cmd_ct(id,level,cid)
{
    if(!
cmd_access(idlevelcid1))
    {
        return 
PLUGIN_HANDLED;
    }

    new 
arg[32], target;
    
read_argv(1arg31);
    
target cmd_target(idargCMDTARGET_NO_BOTS);
    if(!
target) return PLUGIN_HANDLED;

    new 
name[32], targetname[32];
    
get_user_name(idname31);
    
get_user_name(targettargetname31);
    if(
is_user_alive(target))
    
user_silentkill(target);
    
cs_set_user_team(targetCS_TEAM_CT);

    return 
PLUGIN_HANDLED;



georgik57 01-23-2023 06:53

Re: Spectator -> CT or T bug
 
Its either because you don't set a player class or because the spawn plugin doesn't spawn you properly.

deprale 01-23-2023 23:37

Re: Spectator -> CT or T bug
 
try adding this before the user alive check
PHP Code:

    set_pev(idpev_deadflagDEAD_RESPAWNABLE)
    
dllfunc(DLLFunc_Thinkid


Hardix 01-26-2023 08:48

Re: Spectator -> CT or T bug
 
Quote:

Originally Posted by georgik57 (Post 2797805)
Its either because you don't set a player class or because the spawn plugin doesn't spawn you properly.

Tried to set a player class but it didn't worked.

Quote:

Originally Posted by deprale (Post 2797852)
try adding this before the user alive check
PHP Code:

    set_pev(idpev_deadflagDEAD_RESPAWNABLE)
    
dllfunc(DLLFunc_Thinkid


Tried that too, same result. Thanks guys ^^

georgik57 01-26-2023 10:24

Re: Spectator -> CT or T bug
 
Check the spawn plugin. Try using ham_spawn.


All times are GMT -4. The time now is 10:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.