Raised This Month: $ Target: $400
 0% 

[Solved]Best way to set the player to spec when connect?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 08-13-2010 , 01:45   [Solved]Best way to set the player to spec when connect?
Reply With Quote #1

-title-
Sorry for the english.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 08-13-2010 , 01:56   Re: Best way to set the player to spec when connect?
Reply With Quote #2

check if the client is connected and put him to spectator
platzpatrone is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 08-13-2010 , 02:02   Re: Best way to set the player to spec when connect?
Reply With Quote #3

I removed the VGUI menu and I need to know how to set the player in to spec,yes I need to check if he is connected,but in what forward??...
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 08-13-2010 , 02:35   Re: Best way to set the player to spec when connect?
Reply With Quote #4

PHP Code:
public client_putinserverid 
{
       
//here u may set a task with a short delay to
       //initiate ur function where u set the team
       //set_task(5.0,"usertospectator");
       //or initiate it with:  usertospectator( id );
       //the set_task may better while u can be sure the client is connected
}
  
public 
usertospectatorid )
{
   if( 
is_user_connectedid ) )
       
cs_set_user_team idCS_TEAM_SPECTATOR );
  
   return 
PLUGIN_HANDLED;



dont forget to include the cstrike module

a better way would be the Auto Join on Connect from Ven or take a look into Team Join Management from Exolent

Last edited by platzpatrone; 08-13-2010 at 02:46.
platzpatrone is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-13-2010 , 07:49   Re: Best way to set the player to spec when connect?
Reply With Quote #5

#Team_Select & #Team_Select_Spect
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 08-13-2010 , 08:25   Re: Best way to set the player to spec when connect?
Reply With Quote #6

I have solved that problem,now I need to know how to open a menu when user connect.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-13-2010 , 10:56   Re: Best way to set the player to spec when connect?
Reply With Quote #7

Quote:
Originally Posted by #8 SickneSS View Post
I have solved that problem,now I need to know how to open a menu when user connect.
Quote:
Originally Posted by lucas_7_94 View Post
#Team_Select & #Team_Select_Spect
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-13-2010 , 17:11   Re: [Solved]Best way to set the player to spec when connect?
Reply With Quote #8

PHP Code:
#include <amxmodx>
 
new const g_JoinTeamCommand[] = "jointeam";
new 
bool:g_FirstJoin[33];
 
public 
plugin_init()
        
register_clcmd(g_JoinTeamCommand"OnJoinTeam");
 
public 
client_putinserver(Client)
        
g_FirstJoin[Client] = true;
 
public 
OnJoinTeam(Client)
{
        if (!
g_FirstJoin[Client])
                return 
PLUGIN_CONTINUE;
 
        
engclient_cmd(Clientg_JoinTeamCommand"5");
 
        
g_FirstJoin[Client] = false;
 
        return 
PLUGIN_HANDLED;

__________________
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-13-2010 , 17:20   Re: [Solved]Best way to set the player to spec when connect?
Reply With Quote #9

jointeam is not triggered when you use old style menu (as most players do).
Also, add some brackets !
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 21:55.


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