Raised This Month: $ Target: $400
 0% 

Solved CS 1.6 Map Changer Plugin (Under 24 player)


Post New Thread Reply   
 
Thread Tools Display Modes
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 09-03-2024 , 12:06   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #21

as i said, doing it isntantly as the players join or leave is not a good idea since they can cause the maps to loop changes
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-03-2024 , 23:48   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #22

Quote:
Originally Posted by feren02 View Post
Thank you, but how about client_putinserver? what if I define it and add? Would it help?
You probably need to add in a time requirement to each threshold. Something to the effect of "if we have met our threshold for X minutes then change the map". You likely also need a post-map change delay as well to ensure there is enough time to let people download the map and to account for anomalies in internet connectivity.
__________________
fysiks is offline
feren02
Senior Member
Join Date: Mar 2012
Old 09-03-2024 , 23:54   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #23

Quote:
Originally Posted by georgik57 View Post
as i said, doing it isntantly as the players join or leave is not a good idea since they can cause the maps to loop changes
Thanks bro!
feren02 is offline
feren02
Senior Member
Join Date: Mar 2012
Old 09-03-2024 , 23:55   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #24

Quote:
Originally Posted by fysiks View Post
You probably need to add in a time requirement to each threshold. Something to the effect of "if we have met our threshold for X minutes then change the map". You likely also need a post-map change delay as well to ensure there is enough time to let people download the map and to account for anomalies in internet connectivity.
I understand, but I am overwhelmed lolz!
feren02 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-04-2024 , 01:47   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #25

Try this:

PHP Code:
#include <amxmodx>

#define NEW_MAP_DELAY 300
#define TRIGGER_DELAY 120
#define CHECK_TIME 30

new g_bMap_dust
new g_bMap_dust2

new g_iUpperDelayg_iLowerDelay

public plugin_init()
{
    
register_plugin("Player-Based Map Cycler""1.0""")

    new 
szMap[32]
    
get_mapname(szMapcharsmax(szMap))
    
g_bMap_dust equal(szMap"de_dust")
    
g_bMap_dust2 equal(szMap"de_dust2")

    
set_task(float(NEW_MAP_DELAY), "startChecking")
}

public 
startChecking()
{
    
set_task(float(CHECK_TIME), "checkCondition", .flags="b")
}

public 
checkCondition()
{
    new 
iPlayersNum get_playersnum()

    
g_iUpperDelay iPlayersNum 24 g_iUpperDelay CHECK_TIME 0
    g_iLowerDelay 
iPlayersNum 16 g_iLowerDelay CHECK_TIME 0
    
    
if( g_iUpperDelay TRIGGER_DELAY && !g_bMap_dust2 )
    {
        
server_cmd("changelevel de_dust2")
    }
    else if( 
g_iLowerDelay TRIGGER_DELAY && !g_bMap_dust )
    {
        
server_cmd("changelevel de_dust")
    }

You can configure the timing parameters in the #defines toward the top. It's currently set to start checking after 300 seconds after the map start and will then check every 30 seconds. The map will change only if it has met the threshold for 120 continuous seconds.
__________________

Last edited by fysiks; 09-04-2024 at 01:47.
fysiks is offline
feren02
Senior Member
Join Date: Mar 2012
Old 09-04-2024 , 02:10   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #26

Quote:
Originally Posted by fysiks View Post
Try this:

PHP Code:
#include <amxmodx>

#define NEW_MAP_DELAY 300
#define TRIGGER_DELAY 120
#define CHECK_TIME 30

new g_bMap_dust
new g_bMap_dust2

new g_iUpperDelayg_iLowerDelay

public plugin_init()
{
    
register_plugin("Player-Based Map Cycler""1.0""")

    new 
szMap[32]
    
get_mapname(szMapcharsmax(szMap))
    
g_bMap_dust equal(szMap"de_dust")
    
g_bMap_dust2 equal(szMap"de_dust2")

    
set_task(float(NEW_MAP_DELAY), "startChecking")
}

public 
startChecking()
{
    
set_task(float(CHECK_TIME), "checkCondition", .flags="b")
}

public 
checkCondition()
{
    new 
iPlayersNum get_playersnum()

    
g_iUpperDelay iPlayersNum 24 g_iUpperDelay CHECK_TIME 0
    g_iLowerDelay 
iPlayersNum 16 g_iLowerDelay CHECK_TIME 0
    
    
if( g_iUpperDelay TRIGGER_DELAY && !g_bMap_dust2 )
    {
        
server_cmd("changelevel de_dust2")
    }
    else if( 
g_iLowerDelay TRIGGER_DELAY && !g_bMap_dust )
    {
        
server_cmd("changelevel de_dust")
    }

You can configure the timing parameters in the #defines toward the top. It's currently set to start checking after 300 seconds after the map start and will then check every 30 seconds. The map will change only if it has met the threshold for 120 continuous seconds.
Thank you for your time. Appreciate, will check and feedback. I'm learning...
feren02 is offline
feren02
Senior Member
Join Date: Mar 2012
Old 09-12-2024 , 10:44   Re: CS 1.6 Map Changer Plugin (Under 24 player)
Reply With Quote #27

Quote:
Originally Posted by fysiks View Post
Try this:

PHP Code:
#include <amxmodx>

#define NEW_MAP_DELAY 300
#define TRIGGER_DELAY 120
#define CHECK_TIME 30

new g_bMap_dust
new g_bMap_dust2

new g_iUpperDelayg_iLowerDelay

public plugin_init()
{
    
register_plugin("Player-Based Map Cycler""1.0""")

    new 
szMap[32]
    
get_mapname(szMapcharsmax(szMap))
    
g_bMap_dust equal(szMap"de_dust")
    
g_bMap_dust2 equal(szMap"de_dust2")

    
set_task(float(NEW_MAP_DELAY), "startChecking")
}

public 
startChecking()
{
    
set_task(float(CHECK_TIME), "checkCondition", .flags="b")
}

public 
checkCondition()
{
    new 
iPlayersNum get_playersnum()

    
g_iUpperDelay iPlayersNum 24 g_iUpperDelay CHECK_TIME 0
    g_iLowerDelay 
iPlayersNum 16 g_iLowerDelay CHECK_TIME 0
    
    
if( g_iUpperDelay TRIGGER_DELAY && !g_bMap_dust2 )
    {
        
server_cmd("changelevel de_dust2")
    }
    else if( 
g_iLowerDelay TRIGGER_DELAY && !g_bMap_dust )
    {
        
server_cmd("changelevel de_dust")
    }

You can configure the timing parameters in the #defines toward the top. It's currently set to start checking after 300 seconds after the map start and will then check every 30 seconds. The map will change only if it has met the threshold for 120 continuous seconds.
Hi bro!

Took me more than a week to post a reply. It worked 100% totally fine no tweaking needed. Thank you so much.
feren02 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 13:57.


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