Raised This Month: $12 Target: $400
 3% 

Auto join, replace class menu properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 03-29-2015 , 18:29   Auto join, replace class menu properly
Reply With Quote #1

Hello.
I've read somewhere that chooseteam can be bypassed.

Well, what i need is to block team choice and replace for my own class menu. When the player choose the class i will force to join team/class, that's not the problem. I checked Exolent's team manager plugin and i saw he did some stuff related to vgui but i really don't know what it does so, i need to know how i can make this properly.
__________________
Jhob94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-29-2015 , 20:00   Re: Auto join, replace class menu properly
Reply With Quote #2

Have you tried to learn from Exolent's code? Have you tried to use his method to hook the proper event for showing your class menu?

To make it simple, just force them to auto-join spectators and then put up your menu and set their team like you originally planned.
__________________
fysiks is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 03-30-2015 , 15:28   Re: Auto join, replace class menu properly
Reply With Quote #3

Well i guess that's a nice option too.
But i don't want to allow jointeam command after doing that. My idea before was to let 0 spawnpoints for Terro teams so they can't join Terro. And disable allowspectators cvar. But i need this so what about this? It can be bypassed?
PHP Code:
#include <amxmodx>

new bool:Joined[33]

public 
plugin_init()
{
    
register_clcmd("jointeam""cmdhandler")
}

public 
client_connect(id)
    
Joined[id] = false
    
public client_disconnect(id)
    
Joined[id] = false
    
public cmdhandler(id)
{
    if(!
Joined[id])
    {
        
Joined[id] = true
        
return PLUGIN_CONTINUE
    
}
    
    return 
PLUGIN_HANDLED

__________________
Jhob94 is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 03-30-2015 , 16:53   Re: Auto join, replace class menu properly
Reply With Quote #4

Quote:
Originally Posted by Jhob94 View Post
Well i guess that's a nice option too.
But i don't want to allow jointeam command after doing that. My idea before was to let 0 spawnpoints for Terro teams so they can't join Terro. And disable allowspectators cvar. But i need this so what about this? It can be bypassed?
PHP Code:
#include <amxmodx>

new bool:Joined[33]

public 
plugin_init()
{
    
register_clcmd("jointeam""cmdhandler")
}

public 
client_connect(id)
    
Joined[id] = false
    
public client_disconnect(id)
    
Joined[id] = false
    
public cmdhandler(id)
{
    if(!
Joined[id])
    {
        
Joined[id] = true
        
return PLUGIN_CONTINUE
    
}
    
    return 
PLUGIN_HANDLED

Not the best idea of what u want, but here:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("chooseteam""CMD_JoinTeam")
    
register_clcmd("jointeam""CMD_JoinTeam")
    
register_clcmd("joinclass""CMD_JoinTeam")
}

public 
CMD_JoinTeam(id)
{
    
//Make your menu    

Now go log in to steam

Edit: Nvm, no idea what u mean..
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 03-30-2015 at 17:03.
SkumTomteN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-30-2015 , 19:32   Re: Auto join, replace class menu properly
Reply With Quote #5

Quote:
Originally Posted by Jhob94 View Post
Well i guess that's a nice option too.
But i don't want to allow jointeam command after doing that. My idea before was to let 0 spawnpoints for Terro teams so they can't join Terro. And disable allowspectators cvar. But i need this so what about this? It can be bypassed?
PHP Code:
#include <amxmodx>

new bool:Joined[33]

public 
plugin_init()
{
    
register_clcmd("jointeam""cmdhandler")
}

public 
client_connect(id)
    
Joined[id] = false
    
public client_disconnect(id)
    
Joined[id] = false
    
public cmdhandler(id)
{
    if(!
Joined[id])
    {
        
Joined[id] = true
        
return PLUGIN_CONTINUE
    
}
    
    return 
PLUGIN_HANDLED

It looks fine to me. Why do you think there is something wrong with that method?
__________________
fysiks is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-30-2015 , 20:23   Re: Auto join, replace class menu properly
Reply With Quote #6

You need to hook old and new menus to work with teams no? If i understand look at pugmod source:

I blocked change teams in some situations, i think that can help you.

Ps. https://github.com/SmileYzn/CS_PugMo...ting/PugCS.sma
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 03-31-2015 , 04:11   Re: Auto join, replace class menu properly
Reply With Quote #7

Quote:
Originally Posted by ^SmileY View Post
You need to hook old and new menus to work with teams no? If i understand look at pugmod source:

I blocked change teams in some situations, i think that can help you.

Ps. https://github.com/SmileYzn/CS_PugMo...ting/PugCS.sma
I don't think that's a problem, they are already hooked at exolent autojoin, this small code is just to allow people to autojoin with exolent plugin. After that i use cs_set_user_team

@fysiks idk that's why i am asking. I heard hooking chooseteam menu can be bypassed. Idk if the guy meant also need to hook jointeam/class or if he meant it can be bypassed as the blocked commands after 2013 update.
__________________
Jhob94 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-31-2015 , 22:27   Re: Auto join, replace class menu properly
Reply With Quote #8

To me, it's still rather unclear what your asking.
Blocking the menus? Simply hook ShowMenu and VGUIMenu messages ( and filter for the correct values ) and block them.
Showing your own class menu? You can just show it after blocking the other menus.
Force team join? Just use engclient_cmd( "jointeam" .... ) .
And then you won't have to worry about jointeam used after that because it will be blocked.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 10:33.


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