Raised This Month: $51 Target: $400
 12% 

Less than 10 players - change the map


Post New Thread Reply   
 
Thread Tools Display Modes
Il3gal
BANNED
Join Date: Sep 2009
Location: Romania - Hunedoara
Old 09-10-2010 , 08:00   Re: Less than 10 players - change the map
Reply With Quote #11

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Inteligent Map Change"
#define VERSION "0.1"
#define AUTHOR "SAMURAI"


new const g_maps[][] =
{
    
"de_challenge_mini",
    
"de_mini_plaza_dgl",
    
"fy_iceworld3p",
    
"fy_snow",
    
"fy_tuscan",
    
"ka_color",
    
"space_battle_beta"
}

new 
pplayers;



public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0");
    
    
pplayers register_cvar("imc_maxplayers","8");
}


public 
event_new_round()
{
    new 
players get_playersnum(1);
    new 
tleft get_timeleft();
    
    if(
tleft <= 40 && players <= get_pcvar_num(pplayers) )
    {
        new 
mapname[32], str[32];
        
get_mapname(mapname,31);
        
        
formatex(str,31,"%s",g_maps[random(sizeof g_maps)]);
        
        if(!
is_map_valid(str) )
            return 
PLUGIN_CONTINUE;
            
        
        if(
equali(mapname,str) )
            return 
PLUGIN_CONTINUE;
        
        
samurai_map("%s",str);
    }
    
    return 
PLUGIN_CONTINUE;
}
        

/* samurai_map 
ex: samurai_map("de_dust")      */
stock samurai_map(const mapname[], {Float,Sql,Result,_}:...)
{
    if(
strlen(mapname) != 0) {
        
server_cmd("changelevel %s",mapname);
    }
    

Il3gal is offline
Send a message via Yahoo to Il3gal
unforcer
Senior Member
Join Date: Feb 2009
Old 09-11-2010 , 08:41   Re: Less than 10 players - change the map
Reply With Quote #12

i think it will be better if the plugin first show votemap and after that change the choosen by ppl map
unforcer is offline
allieduser
Member
Join Date: Jul 2011
Old 01-13-2012 , 10:07   Re: Less than 10 players - change the map
Reply With Quote #13

who can edit and write this very good plugin?
allieduser is offline
Old 01-13-2012, 10:22
allieduser
This message has been deleted by allieduser.
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 03:07.


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