View Single Post
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 05-12-2020 , 15:36   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #6

not work, in changed map players connectad...

PHP Code:
#include <amxmodx>

#if !defined client_disconnected
#define client_disconnected client_disconnect
#endif

new g_pPlayersNeeded
new g_pChangeTo
new g_iPlayerCount

public plugin_init()
{
    
register_plugin("changed to fy_pool_day""1.0""OciXCrom")
    
g_pPlayersNeeded register_cvar("change_players_needed""1")
    
g_pChangeTo register_cvar("change_to_map""fy_pool_day")
}

public 
plugin_cfg()
{
    new 
szCurrentMap[32], szChangeTo[32]
    
get_mapname(szCurrentMapcharsmax(szCurrentMap))
    
get_pcvar_string(g_pChangeToszChangeTocharsmax(szChangeTo))

    if(
equali(szCurrentMapszChangeTo))
    {
        
pause("d")
    }
}

public 
client_putinserver(id)
{
    if(++
g_iPlayerCount <= get_pcvar_num(g_pPlayersNeeded))
    {
        new 
szMap[32]
        
get_pcvar_string(g_pChangeToszMapcharsmax(szMap))

        
#if defined engine_changelevel
        
engine_changelevel(szMap)
        
#else
        
server_cmd("changelevel %s"szMap)
        
#endif
    
}
}

public 
client_disconnected(id)
{
    
g_iPlayerCount--

when changing the map it shows the number of players and changes the map again before starting, so this plugin does not work.
it does not allow the map if any other than fy_pool_day
__________________

Last edited by rx1983; 05-12-2020 at 15:37.
rx1983 is offline
Send a message via MSN to rx1983