AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto join, replace class menu properly (https://forums.alliedmods.net/showthread.php?t=260693)

Jhob94 03-29-2015 18:29

Auto join, replace class menu properly
 
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.

fysiks 03-29-2015 20:00

Re: Auto join, replace class menu properly
 
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.

Jhob94 03-30-2015 15:28

Re: Auto join, replace class menu properly
 
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



SkumTomteN 03-30-2015 16:53

Re: Auto join, replace class menu properly
 
Quote:

Originally Posted by Jhob94 (Post 2279970)
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.. :)

fysiks 03-30-2015 19:32

Re: Auto join, replace class menu properly
 
Quote:

Originally Posted by Jhob94 (Post 2279970)
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?

^SmileY 03-30-2015 20:23

Re: Auto join, replace class menu properly
 
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

Jhob94 03-31-2015 04:11

Re: Auto join, replace class menu properly
 
Quote:

Originally Posted by ^SmileY (Post 2280061)
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.

hornet 03-31-2015 22:27

Re: Auto join, replace class menu properly
 
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.


All times are GMT -4. The time now is 14:42.

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