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

Solved check players =< 1 changelevel fy_pool_day


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 05-10-2020 , 12:54   check players =< 1 changelevel fy_pool_day
Reply With Quote #1

check players =< 1 changelevel fy_pool_day

I need a seimple plugin that changes the map if the server is zero or one player. automatically,

so that this is verified at the start round of the match after a delay of 30 seconds.

not work, unnaprovad
https://forums.alliedmods.net/showthread.php?t=140481

very old not work
https://forums.alliedmods.net/showthread.php?p=52535

very complex, very options... not simple, chanched commands in server....
https://forums.alliedmods.net/showthread.php?p=194690
__________________

Last edited by rx1983; 05-13-2020 at 11:22.
rx1983 is offline
Send a message via MSN to rx1983
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-10-2020 , 13:53   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=323184
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 05-12-2020 , 09:23   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #3

how to put as topic solved?
__________________
rx1983 is offline
Send a message via MSN to rx1983
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-12-2020 , 10:01   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #4

Quote:
Originally Posted by rx1983 View Post
how to put as topic solved?
Edit 1st post, advanced, solved.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 05-12-2020 , 10:11   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #5

VALEU !
__________________
rx1983 is offline
Send a message via MSN to rx1983
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
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-12-2020 , 15:48   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #7

It works. It does that because the number of players is always <= 1 when the map starts. I added a delay to prevent this:

Code:
#include <amxmodx> #if !defined client_disconnected     #define client_disconnected client_disconnect #endif new g_pPlayersNeeded new g_pChangeTo new g_pWait new g_iPlayerCount new bool:g_bActive public plugin_init() {     register_plugin("Change Map on X Players", "1.1", "OciXCrom")     g_pPlayersNeeded = register_cvar("change_players_needed", "10")     g_pChangeTo = register_cvar("change_to_map", "fy_snow")     g_pWait = register_cvar("change_wait", "30") } public plugin_cfg() {     new szCurrentMap[32], szChangeTo[32]     get_mapname(szCurrentMap, charsmax(szCurrentMap))     get_pcvar_string(g_pChangeTo, szChangeTo, charsmax(szChangeTo))     if(equali(szCurrentMap, szChangeTo))     {         pause("d")     }     set_task(get_pcvar_float(g_pWait), "activate_plugin", .flags = "c") } public activate_plugin() {     g_bActive = true     if(g_iPlayerCount <= get_pcvar_num(g_pPlayersNeeded))     {         change_the_map()     } } public client_putinserver(id) {     if(++g_iPlayerCount <= get_pcvar_num(g_pPlayersNeeded) && g_bActive)     {         change_the_map()     } } public client_disconnected(id) {     g_iPlayerCount-- } public change_the_map() {     g_bActive = false     new szMap[32]     get_pcvar_string(g_pChangeTo, szMap, charsmax(szMap))     #if defined engine_changelevel     engine_changelevel(szMap)     #else     server_cmd("changelevel %s", szMap)     #endif }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
rx1983
Senior Member
Join Date: Jan 2009
Location: BRASIL
Old 05-13-2020 , 11:23   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #8

APPROVED
__________________
rx1983 is offline
Send a message via MSN to rx1983
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 05-13-2020 , 11:47   Re: check players =< 1 changelevel fy_pool_day
Reply With Quote #9

@OciXCrom, Congratulations !!
@HamletEagle, its time for you to retire :p we got new AMXX Approver.
Alber9091 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 08:06.


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