Raised This Month: $32 Target: $400
 8% 

[Help] Autojoin customization.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 04-20-2015 , 16:09   [Help] Autojoin customization.
Reply With Quote #1

Hello, well i got this Autojoin plugin from VEN, and i want to modify it like this -
i wanna do it
with a .ini file, when there i can put some of Client names wich i dont want they to Autojoin on teams, and for others wich are not added in the list to Autojoin normally.
hope understand what i mean. thnx


code
PHP Code:
#include <amxmodx>

#define PLUGIN_NAME "Auto Join on Connect"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN"

#define IMMUNITY_ACCESS_LEVEL ADMIN_CHAT

#define AUTO_TEAM_JOIN_DELAY 0.1

#define TEAM_SELECT_VGUI_MENU_ID 2

new Hour[64], bool:Night;
new 
g_pcvar_team
new g_pcvar_class
new g_pcvar_imm

public plugin_init() {
    
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)

    
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
    
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")

    
g_pcvar_team register_cvar("ajc_team""5")
    
g_pcvar_class register_cvar("ajc_class""5")
    
g_pcvar_imm register_cvar("ajc_imm""1")
}

public 
message_show_menu(msgiddestid) {
    if (!
should_autojoin(id))
        return 
PLUGIN_CONTINUE

    
static team_select[] = "#Team_Select"
    
static menu_text_code[sizeof team_select]
    
get_msg_arg_string(4menu_text_codesizeof menu_text_code 1)
    if (!
equal(menu_text_codeteam_select))
        return 
PLUGIN_CONTINUE

    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

public 
message_vgui_menu(msgiddestid) {

    if (
get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !should_autojoin(id))
        return 
PLUGIN_CONTINUE

    set_force_team_join_task
(idmsgid)

    return 
PLUGIN_HANDLED
}

bool:should_autojoin(id) {
    return (
get_pcvar_num(g_pcvar_team) && !get_user_team(id) && !task_exists(id) && (!get_pcvar_num(g_pcvar_imm) || !(get_user_flags(id) & IMMUNITY_ACCESS_LEVEL)))
}

set_force_team_join_task(idmenu_msgid) {

    static 
param_menu_msgid[2]
    
param_menu_msgid[0] = menu_msgid
    set_task
(AUTO_TEAM_JOIN_DELAY"task_force_team_join"idparam_menu_msgidsizeof param_menu_msgid)
    return 
PLUGIN_CONTINUE;
}

public 
task_force_team_join(menu_msgid[], id) {
    
    if (
get_user_team(id))
    return 

    static 
team[2], class[2]
    
get_pcvar_string(g_pcvar_teamteamsizeof team 1)
    
get_pcvar_string(g_pcvar_class, class, sizeof class - 1)
    
force_team_join(idmenu_msgid[0], team, class)

}

stock force_team_join(idmenu_msgid/* const */ team[] = "5"/* const */ class[] = "0") {
    static 
jointeam[] = "jointeam"
    
if (class[0] == '0') {
        
engclient_cmd(idjointeamteam)
        return
    }

    static 
msg_blockjoinclass[] = "joinclass"
    
msg_block get_msg_block(menu_msgid)
    
set_msg_block(menu_msgidBLOCK_SET)
    
engclient_cmd(idjointeamteam)
    
engclient_cmd(idjoinclass, class)
    
set_msg_block(menu_msgidmsg_block)

__________________

Last edited by ghost95v; 04-26-2015 at 16:37.
ghost95v is offline
Send a message via Skype™ to ghost95v
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 04-21-2015 , 07:31   Re: [Help] Autojoin customization.
Reply With Quote #2

PHP Code:
 return (get_pcvar_num(g_pcvar_team) && !get_user_team(id) && !task_exists(id) && (!get_pcvar_num(g_pcvar_imm) || !(get_user_flags(id) & IMMUNITY_ACCESS_LEVEL))) 
-->

PHP Code:
 return (get_pcvar_num(g_pcvar_team) && !get_user_team(id) && !task_exists(id) && (!get_pcvar_num(g_pcvar_imm) )) 
Obada is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 04-21-2015 , 13:25   Re: [Help] Autojoin customization.
Reply With Quote #3

i know how to do this.. but as i said most important for me Is ->

Quote:
Originally Posted by ghost95v View Post
with a .ini file, when there i can put some of Client names wich i dont want they to Autojoin on teams, and for others wich are not added in the list to Autojoin normally.
hope understand what i mean. thnx
__________________

Last edited by ghost95v; 04-21-2015 at 13:25.
ghost95v is offline
Send a message via Skype™ to ghost95v
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 04-22-2015 , 09:11   Re: [Help] Autojoin customization.
Reply With Quote #4

Quote:
Originally Posted by ghost95v View Post
i know how to do this.. but as i said most important for me Is ->
Then why did you ask how to do it?
Obada is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 04-22-2015 , 10:03   Re: [Help] Autojoin customization.
Reply With Quote #5

Quote:
Originally Posted by Obada View Post
Then why did you ask how to do it?
Can u help me or not?
__________________

Last edited by ghost95v; 04-23-2015 at 18:16.
ghost95v is offline
Send a message via Skype™ to ghost95v
Ali0mer
Senior Member
Join Date: Jan 2016
Location: Iraq
Old 12-06-2018 , 06:10   Re: [Help] Autojoin customization.
Reply With Quote #6

Anyone help here?
Wanna same as his request..
Ali0mer is offline
Send a message via Skype™ to Ali0mer
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-06-2018 , 09:59   Re: [Help] Autojoin customization.
Reply With Quote #7

Push player names to cellarray or trie and force jointeam if player's name not be found in data.
__________________









Last edited by CrazY.; 12-06-2018 at 10:00.
CrazY. is offline
Ali0mer
Senior Member
Join Date: Jan 2016
Location: Iraq
Old 12-06-2018 , 16:15   Re: [Help] Autojoin customization.
Reply With Quote #8

Hii crazy! Thx for reply
If you can show us a full code because im not good in coding language.
Ali0mer is offline
Send a message via Skype™ to Ali0mer
Ali0mer
Senior Member
Join Date: Jan 2016
Location: Iraq
Old 12-10-2018 , 14:50   Re: [Help] Autojoin customization.
Reply With Quote #9

Sorry for Bump please someone?
Ali0mer is offline
Send a message via Skype™ to Ali0mer
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 12-10-2018 , 15:08   Re: [Help] Autojoin customization.
Reply With Quote #10

change the immunity flag to 'x' and put that flag to everyone you want to.
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
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 20:24.


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