Raised This Month: $ Target: $400
 0% 

Auto join spect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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