Raised This Month: $ Target: $400
 0% 

Loophole in this plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aydeev
Junior Member
Join Date: Oct 2014
Old 12-06-2014 , 10:27   Loophole in this plugin?
Reply With Quote #1

Hello,

this plugin controls the team selection of players so that there are even teams in the beginning, and later so that people can join the losing team. It's based on bmann's Teamlocker plugin

In the first 2 minutes of a map: forces players to use auto-select (5) by disabling T (1) and CT (2) selection.
After 2 minutes: Locks auto select (5) and unlocks T (1) and CT (2) so people can join the weaker team.

The plugin looks at both the team menu (command "chooseteam") and the "jointeam" console command. I also had to prevent vgui menus since they allowed to bypass the lock for whatever reason.

Basically the plugin works, but every now and then I get people connecting late and joining the winning team excusing themselves with:

"It's not my fault, I pressed 5 and the server put me in that team".

Since auto-select is disabled at that moment, they must be either lying or there is some way not covered in this plugin.

Can anyone think of any way to bypass the plugin?

PHP Code:
/*
* Original Teamlocker version by Bmann_420
*
* https://forums.alliedmods.net/showthread.php?t=48251
*/ 

new const PLUGIN[]  = "Teamlocker";
new const 
VERSION[] = "1.8"
new const AUTHOR[]  = "Aydeev";

#include <amxmodx>
#include <amxmisc> 
#include <cstrike>

#define TERROR 1
#define CT 2
#define AUTO 5

new bool:blockjoining[6

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4), "team_select"); 
    
register_clcmd("jointeam""join_team");
    
    
register_message(get_user_msgid("VGUIMenu"), "prevent_vgui_menu")
    
    
blockjoining[TERROR] = true
    blockjoining
[CT] = true
    set_task
120.0"unlockTeams" )
}


public 
prevent_vgui_menu(msgiddestid) {
    if (
get_msg_arg_int(1) == ) {
        
set_user_info(id"_vgui_menus""0")
        
client_cmd(id"chooseteam")
        return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE
}


public 
team_select(idkey

    
check_blocked(idkey+1)    
    return 
PLUGIN_HANDLED
}


public 
join_team(id
{
    new 
arg[2
    
read_argv(1arg1)
    
check_blocked(idstr_to_num(arg))
    return 
PLUGIN_HANDLED 
}

public 
check_blocked(idteam) {
    
    new 
teamstring[2]
    
num_to_str(teamteamstring,1)
    
    
//Admin immunity
    
if (get_user_flags(id) & ADMIN_KICK 
    {
        
engclient_cmd(id"jointeam"teamstring)
        return 
PLUGIN_HANDLED
    
}
    
    
// Selected team is blocked, try again and print message
    
if ( blockjoining[team])
    {
        
engclient_cmd(id"chooseteam")
        switch(
team)
        {    
            case 
AUTOclient_print(idprint_chat"[Teamlocker] Auto-select disabled. Check the scores and join the losing team")    
            default: 
client_print(idprint_chat,"[Teamlocker] Manual team picking disabled. Use 5 (Auto-select) to be assigned to a team")    
        }
        return 
PLUGIN_HANDLED 
    
}
    
    
// Selected team is not blocked, so join the team
    
engclient_cmd(id"jointeam"teamstring)
    return 
PLUGIN_HANDLED 
}


public 
unlockTeams(id) {
    
    
blockjoining[TERROR] = false
    blockjoining
[CT] = false
    blockjoining
[AUTO] = true
    
    client_print
(0print_chat"[Teamlocker] Terrorists and Counter-Terrorists unlocked")    
    return 
PLUGIN_HANDLED

Aydeev is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 12-07-2014 , 17:08   Re: Loophole in this plugin?
Reply With Quote #2

Old style join menu maybe?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
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 15:31.


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