Raised This Month: $ Target: $400
 0% 

Auto join spect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Netsys
Senior Member
Join Date: Feb 2010
Old 06-26-2012 , 10:15   Auto join spect
Reply With Quote #1

As could do for players to directly enter spect?
The plugin "join team manager" of exolent not work, appears not reviewed ... players are left as "UNASSIGNED"
Netsys is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-26-2012 , 11:12   Re: Auto join spect
Reply With Quote #2

Don't think so, probably just because of the message block.

With this players will auto join Spectator, but then will be free to join a team when they choose. Is that what your after?
Code:
#include <amxmodx> #include <cstrike> #define VGUI_SELECT_TEAM        2 public plugin_init() {     register_plugin( "Force Join Spec", "0.0.1", "hornet" );         register_message( get_user_msgid("ShowMenu"), "Message_ShowMenu" );     register_message( get_user_msgid("VGUIMenu"), "Message_VGUIMenu" ); } public client_disconnect( id ) {     remove_task( id ); } public Message_ShowMenu( iMsg, iDest, id ) {     if( cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )         return PLUGIN_CONTINUE;         static MESSAGE[] = "#Team_Select", szMsg[ charsmax( MESSAGE ) ];     get_msg_arg_string( 4, szMsg, charsmax( szMsg ) );     if( equal( szMsg, MESSAGE ) )     {         set_task( 0.1, "task_JoinTeam", id );         return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; } public Message_VGUIMenu( iMsg, iDest, id ) {       if( get_msg_arg_int( 1 ) != VGUI_SELECT_TEAM || cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )         return PLUGIN_CONTINUE;             set_task( 0.1, "task_JoinTeam", id );         return PLUGIN_HANDLED; } public task_JoinTeam( id ) {     cs_set_user_team( id, CS_TEAM_SPECTATOR ); }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Netsys
Senior Member
Join Date: Feb 2010
Old 06-26-2012 , 13:54   Re: Auto join spect
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
Code:
#include <amxmodx> #include <cstrike> #define VGUI_SELECT_TEAM        2 public plugin_init() {     register_plugin( "Force Join Spec", "0.0.1", "hornet" );         register_message( get_user_msgid("ShowMenu"), "Message_ShowMenu" );     register_message( get_user_msgid("VGUIMenu"), "Message_VGUIMenu" ); } public client_disconnect( id ) {     remove_task( id ); } public Message_ShowMenu( iMsg, iDest, id ) {     if( cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )         return PLUGIN_CONTINUE;         static MESSAGE[] = "#Team_Select", szMsg[ charsmax( MESSAGE ) ];     get_msg_arg_string( 4, szMsg, charsmax( szMsg ) );     if( equal( szMsg, MESSAGE ) )     {         set_task( 0.1, "task_JoinTeam", id );         return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; } public Message_VGUIMenu( iMsg, iDest, id ) {       if( get_msg_arg_int( 1 ) != VGUI_SELECT_TEAM || cs_get_user_team( id ) != CS_TEAM_UNASSIGNED )         return PLUGIN_CONTINUE;             set_task( 0.1, "task_JoinTeam", id );         return PLUGIN_HANDLED; } public task_JoinTeam( id ) {     cs_set_user_team( id, CS_TEAM_SPECTATOR ); }
This plugin does not work, appears as spect, but this as unasigned. The player can not see other players.

Last edited by Netsys; 06-26-2012 at 14:06.
Netsys is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 14:28   Re: Auto join spect
Reply With Quote #4

After
PHP Code:
client_connect(id) or client_putinserver(id// whichever works for you. 
You can use this:
PHP Code:
cs_set_user_team(id,CS_TEAM_SPECTATOR //Changing team to Spectator. 
I think that after connecting,Players will be forced to join team spectators,I didn't test it,Give it a try.
Waleed is offline
Send a message via Skype™ to Waleed
Netsys
Senior Member
Join Date: Feb 2010
Old 06-26-2012 , 15:30   Re: Auto join spect
Reply With Quote #5

Quote:
Originally Posted by Waleed View Post
After
PHP Code:
client_connect(id) or client_putinserver(id// whichever works for you. 
You can use this:
PHP Code:
cs_set_user_team(id,CS_TEAM_SPECTATOR //Changing team to Spectator. 
I think that after connecting,Players will be forced to join team spectators,I didn't test it,Give it a try.
dont work
Netsys is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-26-2012 , 16:40   Re: Auto join spect
Reply With Quote #6

You cannot, I know when I once tried to set the user's team in client_putinserver, the server crashed.
Backstabnoob is offline
Old 06-26-2012, 17:52
jimaway
This message has been deleted by jimaway. Reason: nvm
Netsys
Senior Member
Join Date: Feb 2010
Old 06-27-2012 , 03:58   Re: Auto join spect
Reply With Quote #7

can be achieved by hooking "ShowMenu" but I do not worked ...
Netsys is offline
Pourya
Member
Join Date: Sep 2011
Location: Iran
Old 10-07-2012 , 08:01   Re: Auto join spect
Reply With Quote #8

hi all
any one can completed this plugin and upload sma file.

thanks all
Pourya is offline
Send a message via Yahoo to Pourya
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 06:10.


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