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

Anyone knows how to spawn instantly, after changing teams?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mmiicchhaaeell
Member
Join Date: Oct 2020
Old 11-23-2020 , 22:35   Anyone knows how to spawn instantly, after changing teams?
Reply With Quote #1

Anyone knows how to spawn instantly, after changing teams? Or after joining the server, if the round just started, I would say within 3-5 seconds. Because right now, I have to wait, until the round ends and then start when the game starts. Same thing if I want to switch teams, it makes me wait one round before I can start playing. Sometimes it makes me wait, even if I switch teams at the end of the round. It still makes me wait one round. Is there a cmd, or a plugin to make the spawn instant? I have seen in other servers, they have several seconds and they still can spawn after the game starts.


Thanks
Mmiicchhaaeell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-24-2020 , 19:02   Re: Anyone knows how to spawn instantly, after changing teams?
Reply With Quote #2

Are you creating a plugin for this? If yes, have you tried Ham_CS_RoundRespawn?
__________________
Bugsy is offline
JaC k
Junior Member
Join Date: Jul 2016
Location: Egypt
Old 11-26-2020 , 03:39   Re: Anyone knows how to spawn instantly, after changing teams?
Reply With Quote #3

If you are using ReAPI, just use this simple code:
PHP Code:
/*
*    This plugin will automatically respawn player directly after manual team change
*    This plugin require ReAPI (Have no idea how to convert to AMXX)
*
*    Code idea from our Zombie Escape Mod
*/

#include <amxmodx>
#include <reapi>

new bool:g_bSwitched[33]

public 
plugin_init()
{
    
register_plugin("Respawn After Team Change""1.0""Raheem")
    
    
RegisterHookChain(RG_HandleMenu_ChooseTeam"HC_HandleMenu_ChooseTeam_Pre"false)
    
RegisterHookChain(RG_HandleMenu_ChooseAppearance"HC_HandleMenu_ChoosedAppearance_Post"true)
    
RegisterHookChain(RG_RoundEnd"HC_RoundEnd_Post"true)
}

public 
HC_HandleMenu_ChooseTeam_Pre(idMenuChooseTeam:iSlot)
{
    if (
iSlot == MenuChoose_CT || iSlot == MenuChoose_T)
    {
        if (
is_user_alive(id))
        {
            
g_bSwitched[id] = true
        
}
    }
}

public 
HC_HandleMenu_ChoosedAppearance_Post(const id, const slot)
{
    if (
g_bSwitched[id])
    {
        
rg_round_respawn(id)
        
g_bSwitched[id] = false
    
}
}

public 
HC_RoundEnd_Post(WinStatus:statusScenarioEventEndRound:eventFloat:tmDelay)
{
    
arrayset(g_bSwitchedfalsecharsmax(g_bSwitched))

In ReGameDLL you can control also the time that during the game where player still respawned:
PHP Code:
// Player cannot respawn until next round
// if more than N seconds has elapsed since the beginning round
//
// Default value: "20"
mp_roundrespawn_time 5 
So using first plugin will respawn the player directly after switching team. And using mp_roundrespawn_time 5 will allow players join the game if not more than 5 seconds elapsed from the round.
JaC k is offline
Mmiicchhaaeell
Member
Join Date: Oct 2020
Old 11-28-2020 , 00:45   Re: Anyone knows how to spawn instantly, after changing teams?
Reply With Quote #4

not using reapi. Not very familiar with reapi. I have heard about the module though.
Mmiicchhaaeell 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 11:33.


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