AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detecting team join (https://forums.alliedmods.net/showthread.php?t=110479)

Doc-Holiday 11-29-2009 21:29

Detecting team join
 
I know you can use event teaminfo to catch join team

But setting respawn there dosent work due to the fact the player can still be on the model screen

Is there away to detect once a player is ready to spawn?

fysiks 11-29-2009 21:33

Re: Detecting team join
 
PreHook spawn.

PHP Code:

RegisterHam(Ham_Spawn"player""functionhere"0


Doc-Holiday 11-29-2009 21:38

Re: Detecting team join
 
Quote:

Originally Posted by fysiks (Post 1002711)
PreHook spawn.

PHP Code:

RegisterHam(Ham_Spawn"player""functionhere"0



Edit:

That would fire when you first join a team and select modle waiting to spawn?

Edit:

Tried it and it dosent work.. What i want i dk if i wasnt clear. i want a way to detect the player chose a model because they can sit there on that screen forever.

Timers dont work on team info. (because it fires when you choose a team not mdl)

Ight well im using fm setmdl.... hawk said something about creating a object that thinks ever second but that is beyond me.

ConnorMcLeod 11-30-2009 01:21

Re: Detecting team join
 
This detects when the player is selecting a skin, it could still be too early to spawn him, you could delay it a bit.
2 detection ways with old style menu, 1 way with VGUI :

PHP Code:

#include <amxmodx>
#include <fakemeta>

new const VERSION[] = "0.0.1"

const EXTRAOFFSET_PLAYER    5
const m_iMenuCode        205
const SKIN_SELECT_MENU    3

public plugin_init()
{
    
register_plugin("Skin Menu"VERSION"ConnorMcLeod")

    
register_menucmd(register_menuid("Terrorist_Select"1), 31"ChooseSkinMenu"// 26, 27
    
register_menucmd(register_menuid("CT_Select"1), 31"ChooseSkinMenu")

    
register_clcmd("joinclass""ClientCommand_JoinClass")
    
register_clcmd("menuselect""ClientCommand_MenuSelect")
}

public 
ChooseSkinMenu(idiKey)
{
    
// Player is selecting a skin with old style menu
}

public 
ClientCommand_MenuSelectid )
{
    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU )
    {
        
// Player is selecting a skin with old style menu
    
}
}

public 
ClientCommand_JoinClassid )
{
    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU )
    {
        
// Player is selecting a skin with VGUI style menu
    
}



Doc-Holiday 12-02-2009 20:59

Re: Detecting team join
 
Quote:

Originally Posted by ConnorMcLeod (Post 1002783)
This detects when the player is selecting a skin, it could still be too early to spawn him, you could delay it a bit.
2 detection ways with old style menu, 1 way with VGUI :

PHP Code:

#include <amxmodx>
#include <fakemeta>

new const VERSION[] = "0.0.1"

const EXTRAOFFSET_PLAYER    5
const m_iMenuCode        205
const SKIN_SELECT_MENU    3

public plugin_init()
{
    
register_plugin("Skin Menu"VERSION"ConnorMcLeod")

    
register_menucmd(register_menuid("Terrorist_Select"1), 31"ChooseSkinMenu"// 26, 27
    
register_menucmd(register_menuid("CT_Select"1), 31"ChooseSkinMenu")

    
register_clcmd("joinclass""ClientCommand_JoinClass")
    
register_clcmd("menuselect""ClientCommand_MenuSelect")
}

public 
ChooseSkinMenu(idiKey)
{
    
// Player is selecting a skin with old style menu
}

public 
ClientCommand_MenuSelectid )
{
    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU )
    {
        
// Player is selecting a skin with old style menu
    
}
}

public 
ClientCommand_JoinClassid )
{
    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU )
    {
        
// Player is selecting a skin with VGUI style menu
    
}




as of now im using fm_setmdl.... and then im putting a set_task of 3 seconds


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

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