Raised This Month: $ Target: $400
 0% 

Map Size Picker


Post New Thread Reply   
 
Thread Tools Display Modes
busdi
New Member
Join Date: Feb 2007
Old 02-17-2007 , 12:02   Re: Map Size Picker
Reply With Quote #31

Hy

nice work

In the moment im running the deagsmapmanage230b plugin to vote maps.
But in future i will change it, but in the old plugin there is one nice feature, too.
The rockthevote feature.
You can rock the vote by typing "rockthevote" in the console. When more people will do this the mapvote starts before the map ends.

it will be very nice if you can put this feature in your plugin too.

thx busdi

sorry for my bad english
busdi is offline
Identity
Member
Join Date: Mar 2007
Old 04-01-2007 , 17:24   Re: Map Size Picker
Reply With Quote #32

[AMXX] Displaying debug trace (plugin "test\amx_msp.amxx")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] amx_msp.sma::plugin_init (line 57)
Identity is offline
Old 04-09-2007, 17:57
djwhitey
This message has been deleted by djwhitey. Reason: wrong thread
Octav
New Member
Join Date: Apr 2007
Old 04-15-2007 , 06:59   Re: Map Size Picker
Reply With Quote #33

Quote:
Originally Posted by Identity View Post
[AMXX] Displaying debug trace (plugin "test\amx_msp.amxx")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] amx_msp.sma::plugin_init (line 57)
L 04/15/2007 - 14:008: [AMXX] Displaying debug trace (plugin "amx_msp.amxx")
L 04/15/2007 - 14:008: [AMXX] Run time error 4: index out of bounds
L 04/15/2007 - 14:008: [AMXX] [0] 13600.attach::plugin_init (line 57)
L 04/15/2007 - 14:00:41: [AMXX] Displaying debug trace (plugin "amx_msp.amxx")
L 04/15/2007 - 14:00:41: [AMXX] Run time error 4: index out of bounds
L 04/15/2007 - 14:00:41: [AMXX] [0] 13600.attach::client_putinserver (line 210)


got kind of ... same problem... :
Octav is offline
crt123
New Member
Join Date: Mar 2006
Old 06-14-2007 , 14:57   Re: Map Size Picker
Reply With Quote #34

same problem here.....
Can anybody fix this?

THX
crt123 is offline
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 06-27-2007 , 16:10   Re: Map Size Picker
Reply With Quote #35

Be sure NOT to leave empty line after last map name - so NO enters. I'm not releasing any new versions of this plugin, currently working on new one which will choose next map that isn't in the group of currently played one Will post it soon.
__________________
KobraPL is offline
crt123
New Member
Join Date: Mar 2006
Old 07-02-2007 , 12:56   Re: Map Size Picker
Reply With Quote #36

THX for the tip. I will check....

Currently the plugin is modified a little to be inactive while an admin of certain rank is present on the server and works great.
Really, I can live with this error, except for the spam in server logs.

Nice job KobraPL.
Waiting for new plugins from you

Last edited by crt123; 07-02-2007 at 13:09.
crt123 is offline
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 07-17-2007 , 11:54   Re: Map Size Picker
Reply With Quote #37

Here it is - my new plugin amx_mapgroup
__________________
KobraPL is offline
Special
Member
Join Date: Jan 2005
Old 07-24-2007 , 10:41   Re: Map Size Picker
Reply With Quote #38

Hi KobraPL,

I realy like this plugin. I installed it on my server. Befor I used Deagles Map Management. Maby you can add The RockTheVote and mapnominations in the future.

Okay, ontopic I get this error:

Code:
L 07/24/2007 - 14:40:36: [AMXX] Displaying debug trace (plugin "amx_msp.amxx")
L 07/24/2007 - 14:40:36: [AMXX] Run time error 4: index out of bounds 
L 07/24/2007 - 14:40:36: [AMXX]    [0] 13600.attach::menu_handler (line 291)
L 07/24/2007 - 14:40:36: [AMXX] Displaying debug trace (plugin "amx_msp.amxx")
L 07/24/2007 - 14:40:36: [AMXX] Run time error 4: index out of bounds 
L 07/24/2007 - 14:40:36: [AMXX]    [0] 13600.attach::client_putinserver (line 210)
L 07/24/2007 - 14:40:36: [AMXX]    [1] 13600.attach::client_disconnect (line 219)
L 07/24/2007 - 14:40:47: Start of error session.
L 07/24/2007 - 14:40:47: Info (map "de_dust2") (logfile "error_072407.log")
L 07/24/2007 - 14:40:47: [AMXX] Displaying debug trace (plugin "amx_msp.amxx")
L 07/24/2007 - 14:40:47: [AMXX] Run time error 4: index out of bounds 
L 07/24/2007 - 14:40:47: [AMXX]    [0] 13600.attach::client_putinserver (line 210)
Code:
de_aztec 4 10
de_dust 4 10
de_westwood 4 10
cs_italy 4 10
gg_33_battle 4 10
de_dust2 4 16
de_nuke 4 16
de_inferno 8 16
de_train 8 16
de_forge 8 16
de_cpl_mill 8 16
de_cpl_fire 8 16
de_cpl_strike 8 16
cs_office 8 16
cs_assault 8 16
(No enters at the end)
__________________
Special is offline
Special
Member
Join Date: Jan 2005
Old 08-02-2007 , 07:51   Re: Map Size Picker
Reply With Quote #39

Too many errors for me. I went back to The Deagle.
__________________
Special is offline
Barkli
Junior Member
Join Date: Oct 2006
Old 09-05-2007 , 17:36   Re: Map Size Picker
Reply With Quote #40

Code:
/* Plugin generated by AMXX-Studio */ 
 
#define PLUGIN "Map Size Picker" 
#define VERSION "1.6" 
#define AUTHOR "Kobra aka kbr_Kobra aka KobraPL" 
 
 
/* AMX Mod X 
*   Map Size Picker 
* 
* by Kobra 
*/ 
 
#include <amxmodx> 
#include <amxmisc> 
 
// Change this if You have less/more maps in Your msp.ini config file 
#define MAX_MAPS 300 
 
// This changes the number of maps in a vote 
#define MAX_VOTE_MAPS 6 
 
new menu 
new g_playerCount 
new g_mspMapName[MAX_MAPS][32] 
new g_mspMapMin[MAX_MAPS] 
new g_mspMapMax[MAX_MAPS] 
new g_mspCount=0 
new g_mspCurrentMapMin 
new g_mspCurrentMapMax 
new g_mspCurrentMapName[32] 
new g_mspCountDown=0 
new g_mspVoteResults[MAX_VOTE_MAPS] 
new g_mspChoices[MAX_VOTE_MAPS][32] 
new g_mspNewMap[32] 
new g_lastTime 
new g_countDown
new g_mspNoOfMapsToChouse                    //added by barkli 
 
public plugin_init() 
{ 
    register_plugin("Map Size Picker", AMXX_VERSION_STR, "Kobra") 
    register_clcmd("amx_msp", "writeMapConfig", ADMIN_MAP, " - saves the MSP config for current map.") 
    register_clcmd("amx_mspvote","forceVote",ADMIN_VOTE, " - forces the vote.") 
    g_playerCount = get_playersnum(0) 
    get_mapname(g_mspCurrentMapName,32) 
    new i,tmpSA[5],tmpSB[5],tmpS[16],tmpAll[2048],tmpMap[32],tmpMin=0,tmpMax=0,mspFile[128] 
    get_configsdir(mspFile,128) 
    add(mspFile,128,"/msp.ini") 
    i=fopen(mspFile,"rt") 
    if(i==0){ 
        set_hudmessage(255, 0, 0, -1.0, 0.89, 0, 2.0, 20.0,0.1,0.1,-1) 
        show_hudmessage(0,"Error amx_msp loading config file!") 
    } else { 
        while (!feof(i)) // Reading msp config from msp.ini  
        { 
            fgets(i,tmpAll,3000) 
            if ((strlen(tmpAll) > 0) && (tmpAll[strlen(tmpAll)-1] == '^n'))   //changed by barkli 
                tmpAll[strlen(tmpAll)-1] = 0 
            strbreak(tmpAll,tmpMap,31,tmpS,15) 
            strbreak(tmpS,tmpSA,4,tmpSB,4) 
            tmpMin=str_to_num(tmpSA) 
            tmpMax=str_to_num(tmpSB) 
            copy(g_mspMapName[g_mspCount],32,tmpMap) 
            if(tmpMin>0 && tmpMax>0){ 
                 
                g_mspMapMin[g_mspCount]=tmpMin 
                g_mspMapMax[g_mspCount]=tmpMax 
                if(equali(tmpMap,g_mspCurrentMapName)) 
                { 
                    g_mspCurrentMapMin=tmpMin 
                    g_mspCurrentMapMax=tmpMax 
                } 
                g_mspCount++ 
            } 
        } 
        fclose(i) 
        // Remove this if You don't want MSP to show vote at the end of map time. 
        // Update 1.4: This will help, if the server uses mp_maxrounds - vote won't show up on map's end (why should it? ;)) 
        if(get_timeleft()>0){ 
            set_task(15.0, "checkEndTime",0, "", 0, "b")  
        } 
    } 
} 
 
public checkEndTime(){ 
 
    new timeleft = get_timeleft() 
    if(timeleft<30 && g_mspCountDown==0){ 
        g_mspCountDown=1 
        g_countDown=0 
        runVote() 
    } 
} 
 
public writeMapConfig(id){ 
    if(read_argc()==3) 
    { 
        new s[2],min,max,err[50] 
        read_argv(1,s,2) 
        min=str_to_num(s) 
        read_argv(2,s,2) 
        max=str_to_num(s) 
        if(min>max) 
            copy(err,50,"Min has to be larger than Max") 
        if(min<2) 
            copy(err,50,"Min has to be larger than 1") 
        if(max>32)                                              //changedby barkli 
            copy(err,50,"Max has to be smaller than 32")    //changedby barkli 
        if(g_mspCurrentMapMin!=0 && g_mspCurrentMapMax!=0) 
            copy(err,50,"Map has already got MSP config.") 
        if(strlen(err)==0){ 
            new d[50],mspFile[128] 
            get_configsdir(mspFile,128) 
            add(mspFile,128,"/msp.ini") 
            new i=fopen(mspFile,"at") 
             
            format(d,50,"^n%s %d %d",g_mspCurrentMapName,min,max) 
            fputs(i,d) 
            fclose(i) 
            g_mspCurrentMapMin=min 
            g_mspCurrentMapMax=max 
            client_putinserver(id) 
 
        } else { 
            console_print(id,"%s",err) 
        } 
         
    } else { 
        console_print(id,"Use: amx_msp Min Max") 
    } 
} 
 
public client_putinserver(id) 
{ 
    new timeElapsed,time 
    if(g_mspCurrentMapMin==0 && g_mspCurrentMapMax==0) 
    { 
        set_hudmessage(44, 44, 129, -1.0, 0.02, 0, 2.0, 20.0,0.1,0.1,-1) 
        show_hudmessage(0, "The map doesn't have information about optimal player count!") 
        //show_hudmessage(0, "Mapa nie posiada inforamcji na temat optymalnej ilosci graczy!^nZglos na forum swoja propozycje.") 
    } else { 
         
        g_playerCount = get_playersnum(0) 
        if(g_playerCount<2) 
            g_playerCount=2 
        if(g_playerCount>32)                    //changed by barkli 
            g_playerCount=32                //changed by barkli 
             
        if ( g_playerCount > g_mspCurrentMapMax && g_mspCountDown==0) 
        { 
            if(g_lastTime==0) 
            { 
                timeElapsed=0 
            } else { 
                timeElapsed=g_lastTime-g_countDown 
            } 
            time=60/(g_playerCount-g_mspCurrentMapMax)-timeElapsed 
            g_countDown=time 
            g_lastTime=time 
            g_mspCountDown=1 
            runVote() 
        } 
 
        if (g_playerCount < g_mspCurrentMapMin && g_mspCountDown==0) 
        { 
            if(g_lastTime==0) 
            { 
                timeElapsed=0 
            } else { 
                timeElapsed=g_lastTime-g_countDown 
            } 
            time=180/(g_mspCurrentMapMin-g_playerCount)-timeElapsed 
            g_countDown=time 
            g_lastTime=time 
            g_mspCountDown=1 
            runVote() 
        } 
         
        if( g_playerCount <= g_mspCurrentMapMax && g_playerCount >= g_mspCurrentMapMin){ 
            g_mspCountDown=0 
            g_lastTime=0 
            g_countDown=0 
            g_lastTime=0 
        } 
    } 
    g_playerCount=get_playersnum(0) 
    new nextmap[32],found=-1,i 
    get_cvar_string("amx_nextmap",nextmap,31)
        for(i=0;i<g_mspCount;i++) 
    { 
        if(equali(g_mspMapName[i],nextmap)) 
        { 
            found=i 
        } 
    } 
    log_amx("Mapa: %s Found: %d",nextmap,found)
    if(found==-1 || g_mspMapMin[found]>g_playerCount || g_mspMapMax[found]<g_playerCount ) 
    { 
        new goodMaps[MAX_MAPS] 
        new goodMapsIndex=0 
        for(i=0;i<g_mspCount;i++) 
        { 
            if(g_mspMapMin[i]<=g_playerCount && g_mspMapMax[i]>=g_playerCount) 
            { 
                goodMaps[goodMapsIndex]=i 
                goodMapsIndex++ 
            } 
        } 
        new rand=random(goodMapsIndex) 
        set_cvar_string("amx_nextmap",g_mspMapName[goodMaps[rand]]) 
        log_amx("Nextmap changed from %s to %s due to incorrect player count!",nextmap,g_mspMapName[goodMaps[rand]]); 
        client_print(0, print_chat, "Nextmap changed from %s to %s due to incorrect player count!",nextmap,g_mspMapName[goodMaps[rand]]); 
    } 
 
} 
 
public client_disconnect(id) 
{ 
    client_putinserver(id) 
} 
 
public runVote() 
{ 
    if(g_mspCountDown==1){ 
        if(g_countDown>0) 
        { 
            set_hudmessage(44, 44, 129, -1.0, 0.02, 0, 2.0, 1.0,0.1,0.1,-1) 
            //show_hudmessage(0, "Mapa nie nadaje sie na aktualna ilosc graczy!^nZa %ds nastapi glosowanie na zmiane mapy.",g_countDown) 
            show_hudmessage(0, "Incorrect player count for this map!^nVote starts in %ds.",g_countDown) 
            g_countDown-- 
            set_task(1.0,"runVote",0)  
        } else { 
            set_hudmessage(44, 44, 129, -1.0, 0.02, 0, 2.0, 20.0,0.8,0.8,-1) 
            //show_hudmessage(0, "Glosowanie na zmiane mapy!") 
            show_hudmessage(0, "Map vote!") 
            prepareMspMenu() 
            for(new k=1;k<=32;k++) 
            { 
                if(is_user_connected(k)) 
                    menu_display(k, menu, 0); 
            } 
            client_cmd(0, "spk Gman/Gman_Choose2") 
        } 
    } else { 
            set_hudmessage(44, 44, 129, -1.0, 0.02, 0, 2.0, 10.0,0.1,0.1,-1) 
            show_hudmessage(0, "Countdown stopped! Player count accepted!") 
    } 
} 
 
public prepareMspMenu() 
{ 
    if(g_playerCount<2) 
        g_playerCount=2 
    //if(g_playerCount>18) 
    //    g_playerCount=18 
    new goodMaps[MAX_MAPS] 
    new goodMapsIndex=0 
    for(new i=0;i<g_mspCount;i++) 
    { 
        if(g_mspMapMin[i]<=g_playerCount && g_mspMapMax[i]>=g_playerCount) 
        { 
                        goodMaps[goodMapsIndex]=i 
            goodMapsIndex++
 
        } 
    }
        for (new i = goodMapsIndex; i<g_mspCount; i++)
        {
                goodMaps[goodMapsIndex]= -1
        }
 
    new rand=0,i=0
        new mapsLeftForChousing = goodMapsIndex                         //added by barkli
        g_mspNoOfMapsToChouse = 0                                    //added by barkli
        while(i<MAX_VOTE_MAPS && mapsLeftForChousing>0)                 //changed by barkli 
    { 
        rand=random(goodMapsIndex)                 
        if(goodMaps[rand]>-1) 
        { 
            copy(g_mspChoices[i],32,g_mspMapName[goodMaps[rand]])   //changed by barkli 
            goodMaps[rand]=-1
                        g_mspNoOfMapsToChouse ++                                //added by barkli
                        mapsLeftForChousing --                                   //added by barkli 
            i++ 
        } 
    } 
    menu = menu_create("Choose map", "menu_handler")
        if (g_mspNoOfMapsToChouse > MAX_VOTE_MAPS)                          //added by barkli
        {
                g_mspNoOfMapsToChouse = MAX_VOTE_MAPS
        } 

    for(i=0;i<g_mspNoOfMapsToChouse;i++){                               //changed by barkli
                menu_additem(menu, g_mspChoices[i], g_mspChoices[i], ADMIN_ALL) 
    }
    set_task(15.0,"voteEnd",0) 
    return PLUGIN_HANDLED 
     
} 
 
 
public menu_handler(id, menu, item) { 
    new name[64] 
    get_user_name(id, name,64)  
    client_print(0, print_chat, "%s has chosen %s",name,g_mspChoices[item]); 
    g_mspVoteResults[item]++ 
    return PLUGIN_HANDLED; 
} 
 
public voteEnd() { 
    new winner 
    new k 
    for(new z=0;z<=32;z++){ 
        for(k=g_mspNoOfMapsToChouse-1;k>=0;k--){                //changed by barkli 
            if(z==g_mspVoteResults[k]) 
                winner=k 
        } 
    } 
     
    client_print(0, print_chat, "Changing map to %s!",g_mspChoices[winner]); 
    copy(g_mspNewMap,32,g_mspChoices[winner]) 
    changeMap("5") 
} 
 
public changeMap(czas[3]){ 
    new t=str_to_num(czas) 
    if(t>0) 
    { 
        new param[2] 
        set_hudmessage(44, 44, 129, -1.0, -1.00, 0, 2.0, 1.0,0.1,0.1,-1) 
        show_hudmessage(0, "Changing map to ^n%s^nin %ds",g_mspNewMap,t) 
        t-- 
        num_to_str(t,param,2) 
        set_task(1.0,"changeMap",0,param,2) 
    } else { 
        log_amx("[MSP] Changing map to %s from %s with %d players.",g_mspNewMap,g_mspCurrentMapName,g_playerCount) 
        server_cmd("changelevel %s", g_mspNewMap) 
    } 
} 
 
public forceVote() 
{ 
    g_mspCountDown=1 
    g_countDown=0 
    runVote() 
} 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } 
*/
2 runtime errors & many logical ones
I fixed some now at least it is functional.
command doesn;t work etc.

Everything that I have changed has //added or changed by barkli
at the end of the line.

Barkli

Last edited by Barkli; 09-05-2007 at 17:45.
Barkli is offline
Old 09-06-2007, 08:46
Barkli
This message has been deleted by Barkli.
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 13:17.


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