Raised This Month: $ Target: $400
 0% 

Auto Map Change On Empty Server 1.42


Post New Thread Reply   
 
Thread Tools Display Modes
Kamikatze
Member
Join Date: Apr 2004
Old 10-16-2004 , 21:06  
Reply With Quote #21

wow this was fast

I've made it by myself...

Quote:
#include <amxmodx>

new curtime,staytime,bots

public plugin_init()
{
register_plugin("Empty Server","1.2a","twistedeuphoria")
register_cvar("amx_staytime","600")
register_cvar("amx_nmap1","de_dust")
register_cvar("amx_nmap2","de_aztec")
register_cvar("amx_nmap3","de_inferno")
register_cvar("amx_nmap4","de_dust2")
register_cvar("amx_nmap5","de_cbble")
register_cvar("amx_idletime","5")
curtime = 0
bots = 0
staytime = get_cvar_num("amx_staytime")
set_task(1.0,"timer",0,"curtime",0,"b",1)
return PLUGIN_CONTINUE
}

public timer()
{
bots = get_cvar_num("bot_quota")
if((get_playersnum() == 0) || (get_playersnum() - bots == 0))
{
curtime ++
if(curtime >= staytime)
change_maps()
}
else

{
new players,i,idleplayers
players = get_playersnum()
for(i=1;i<=get_maxplayers();i++)
{
if(get_user_time(i,1) >= (get_cvar_num("amx_idletime") * 216000))
{
idleplayers++
}
}
if(players == idleplayers)
{
curtime++
if(curtime >= staytime)
change_maps()
}
else
curtime = 0
}
return curtime
}

public change_maps()
{
new maps[6][32],num,curmap[32]
get_mapname(curmap,31)
get_cvar_string("amx_nmap1",maps[0],31)
get_cvar_string("amx_nmap2",maps[1],31)
get_cvar_string("amx_nmap3",maps[2],31)
get_cvar_string("amx_nmap4",maps[3],31)
get_cvar_string("amx_nmap5",maps[4],31)
num = random_num(0,4)
while(equali(maps[num],curmap))
{
num = random_num(0,4)
}
server_cmd("changelevel %s",maps[num])
return PLUGIN_HANDLED
}
other way... but works too
__________________
Kamikatze
visit us at http://www.popl-clan.de
Kamikatze is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 12-27-2004 , 17:21  
Reply With Quote #22

Update:
-Added cvar amx_smartmap (default 1). When smart map is turned on, a list of maps with rounds played and players connected is created. When the time come to change maps, instead of looking at the nmap cvars, the plugin chooses randomly from the top 5 players/round map.
__________________
twistedeuphoria is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 12-29-2004 , 02:21  
Reply With Quote #23

Fixed.
__________________
twistedeuphoria is offline
Kamikatze
Member
Join Date: Apr 2004
Old 06-23-2005 , 20:41  
Reply With Quote #24

Does amx_smartmap count bots? If yes.. please remove that..
__________________
Kamikatze
visit us at http://www.popl-clan.de
Kamikatze is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 06-23-2005 , 20:56  
Reply With Quote #25

*shakes fist* bah! ^--------- updated
__________________
twistedeuphoria is offline
bobo shooter
Junior Member
Join Date: Nov 2004
Old 06-25-2005 , 13:00  
Reply With Quote #26

Btw, can anyone tell me where can dl bots plugins?

Thanks
bobo shooter is offline
DB7654321
New Member
Join Date: Sep 2005
Old 09-06-2005 , 01:37  
Reply With Quote #27

I have one feature request: Treat HLTVs like bots...IE: Don't count them. This is a handy plugin...Thanks!
DB7654321 is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-07-2005 , 15:43  
Reply With Quote #28

Update ~ Version 1.42:
-Plugin now ignores HLTV in player count
__________________
twistedeuphoria is offline
x_fl1p
Junior Member
Join Date: Sep 2005
Old 09-26-2005 , 19:07  
Reply With Quote #29

how exactly do i type that in the cvar

amx_nde_dust2
amx_nde_dust

or

amx_nde_dust2 (amx_nde_dust)
x_fl1p is offline
kap0ne
Member
Join Date: Sep 2005
Old 10-17-2005 , 12:46  
Reply With Quote #30

mine changes but changes to the maps that are loaded on server in order of ABC's so aim maps in order then awp maps

but in my cvars i have all 5 maps de_rats

Quote:
#include <amxmodx>
#include <amxmisc>
#include <float>

new filepath[251],curtime=0,staytime=0,curplayers=0,currounds= 0

public plugin_init()
{
register_plugin("Empty Server","1.42","twistedeuphoria")
register_cvar("amx_staytime","600")
register_cvar("amx_nmap1","de_rats")
register_cvar("amx_nmap2","de_rats")
register_cvar("amx_nmap3","de_rats")
register_cvar("amx_nmap4","de_rats")
register_cvar("amx_nmap5","de_rats")
register_cvar("amx_idletime","5")
register_cvar("amx_smartmap","0")
register_logevent("newround",2,"1=Round_Start ")
staytime = get_cvar_num("amx_staytime")
set_task(1.0,"timer",0,"curtime",0,"b",1)
new directory[201]
get_datadir(directory,200)
format(filepath,250,"%s/emptyserver.txt",directory)
if(!file_exists(filepath))
{
new writestr[201]
format(writestr,200,"Map - Rounds Played - Total Players")
write_file(filepath,writestr)
}
}
kap0ne 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 05:02.


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