Raised This Month: $ Target: $400
 0% 

Detecting team join


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-29-2009 , 21:29   Detecting team join
Reply With Quote #1

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?
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-29-2009 , 21:33   Re: Detecting team join
Reply With Quote #2

PreHook spawn.

PHP Code:
RegisterHam(Ham_Spawn"player""functionhere"0
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-29-2009 , 21:38   Re: Detecting team join
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
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.

Last edited by Doc-Holiday; 11-30-2009 at 00:11.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2009 , 01:21   Re: Detecting team join
Reply With Quote #4

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
    
}

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-02-2009 , 20:59   Re: Detecting team join
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
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
Doc-Holiday is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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