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

[REQ] BB Player auto respawn on connect!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 08-29-2022 , 02:27   [REQ] BB Player auto respawn on connect!
Reply With Quote #1

Hi.
I need a plugin that auto respawn player when Player connect to the server.
I found this but it's for zp and i don't know how to change it for BB.
https://forums.alliedmods.net/showthread.php?t=179546

I have facing that problem When Player connect to the server and if he join builder team then he didn't got auto respawn Admins will revive him using /revive Command.
Can anyone make the plugin who respawn players when they join server?

Last edited by crystal xtreme; 09-04-2022 at 06:47.
crystal xtreme is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-29-2022 , 10:51   Re: [REQ] |BB| Player auto respawn on connect!
Reply With Quote #2

what bb version are you using? Share a link if possible

Can players choose a team or are they automatically assigned one?
__________________

Last edited by Napoleon_be; 08-29-2022 at 10:55.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 08-29-2022 , 12:12   Re: [REQ] |BB| Player auto respawn on connect!
Reply With Quote #3

Iam using BaseBuilder69 Version By Nar X Kali. ( Sorry i do not have link )
And also using auto join on connect:
https://forums.alliedmods.net/showthread.php?p=438587

Last edited by crystal xtreme; 08-29-2022 at 12:21.
crystal xtreme is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-29-2022 , 14:43   Re: [REQ] |BB| Player auto respawn on connect!
Reply With Quote #4

Replace this with your original "auto join on connect" plugin.

Let me know if it works. I might need to add a delay to make it function correctly.

PHP Code:
/* AMX Mod X
*   Auto Join on Connect
*
* (c) Copyright 2007 by VEN
*
* This file is provided as is (no warranties)
*
*     DESCRIPTION
*       Plugin allow to players automatically join team/team&class on connect.
*
*     CVARS
*       ajc_team (0: OFF, N: team index, 5: auto team, default: 5) - controls team join
*       ajc_class (0: OFF, N: class index, 5: auto class, default: 5) - controls class join
*       ajc_imm (0: OFF, 1: ON, default: 1) - don't affect on immuned players (ON/OFF)
*
*     CREDITS
*       Major__ - inquiry
*/

#include <amxmodx>
#include <hamsandwich>

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

#define IMMUNITY_ACCESS_LEVEL ADMIN_IMMUNITY

#define AUTO_TEAM_JOIN_DELAY 0.1

#define TEAM_SELECT_VGUI_MENU_ID 2

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)
}

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)
    
ExecuteHamB(Ham_CS_RoundRespawnid)
}

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)

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 09-04-2022 , 06:48   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #5

Sorry for late reply. But it's not working brother.
crystal xtreme is offline
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 09-05-2022 , 10:33   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #6

It's not working.
crystal xtreme is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-05-2022 , 14:35   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #7

What's not working, is it just not respawning as it should be or what's the problem? Please give me some info lol
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
crystal xtreme
Member
Join Date: Sep 2021
Location: Pakistan, Karachi.
Old 09-05-2022 , 15:21   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #8

Not respawn when player connect after prep time and join builder team.
I need to add auto respawn when player connects after prep time and joins builders team.

Last edited by crystal xtreme; 09-05-2022 at 15:22.
crystal xtreme is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 09-05-2022 , 15:51   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #9

there is already that on basebuilder 6.5, if someone connects (builder or zm) it will be respawned in 7 seconds or smth like that..
exactly..
PHP Code:
public Respawn_Player(id)
{
    
id-=TASK_RESPAWN
    
    
if (!is_user_connected(id))
        return 
PLUGIN_HANDLED
    
    
if (((g_boolCanBuild || g_boolPrepTime) && cs_get_user_team(id) == CS_TEAM_CT) || cs_get_user_team(id) == CS_TEAM_T)
    {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
        
        
//Loop the task until they have successfully spawned
        
if (!g_isAlive[id])
            
set_task(3.0,"Respawn_Human",id+TASK_RESPAWN)
    }
    return 
PLUGIN_HANDLED

__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-05-2022 , 18:09   Re: [REQ] BB Player auto respawn on connect!
Reply With Quote #10

oh well yea i shouldve just set a timer, didn't know it was built into BB tho lmfao
__________________

Last edited by Napoleon_be; 09-05-2022 at 18:09.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 10:46.


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