AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved]Best way to set the player to spec when connect? (https://forums.alliedmods.net/showthread.php?t=135133)

#8 SickneSS 08-13-2010 01:45

[Solved]Best way to set the player to spec when connect?
 
-title-
Sorry for the english.

platzpatrone 08-13-2010 01:56

Re: Best way to set the player to spec when connect?
 
check if the client is connected and put him to spectator

#8 SickneSS 08-13-2010 02:02

Re: Best way to set the player to spec when connect?
 
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??...

platzpatrone 08-13-2010 02:35

Re: Best way to set the player to spec when connect?
 
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

lucas_7_94 08-13-2010 07:49

Re: Best way to set the player to spec when connect?
 
#Team_Select & #Team_Select_Spect

#8 SickneSS 08-13-2010 08:25

Re: Best way to set the player to spec when connect?
 
I have solved that problem,now I need to know how to open a menu when user connect.

lucas_7_94 08-13-2010 10:56

Re: Best way to set the player to spec when connect?
 
Quote:

Originally Posted by #8 SickneSS (Post 1269553)
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 (Post 1269530)
#Team_Select & #Team_Select_Spect


hleV 08-13-2010 17:11

Re: [Solved]Best way to set the player to spec when connect?
 
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;



ConnorMcLeod 08-13-2010 17:20

Re: [Solved]Best way to set the player to spec when connect?
 
jointeam is not triggered when you use old style menu (as most players do).
Also, add some brackets !


All times are GMT -4. The time now is 21:55.

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