Raised This Month: $ Target: $400
 0% 

Simply: needing 2 things into vars and dont get it!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 05-02-2010 , 08:10   Re: Simply: needing 2 things into vars and dont get it!
Reply With Quote #4

Did you add checking at the "END OF MAP" yourself? Because original version does it at the beginning of the map.

I added checking for min and max players in a lot simpler way (just need to add "#min max" in maps file and maps in following lines will only be used iif ( min <= players amount <= max )):
PHP Code:
    new szText[32], szTmp[32]
    new 
currentMap[32]
    new 
min=0max=get_maxplayers(), pnum=0
    
new buff[256];

    for(new 
i=1i<=maxi++)
        if((
is_user_connecting(i) || is_user_connected(i)) && !is_user_hltv(i) && !is_user_bot(i))
            
pnum++


    
get_mapname(currentMap31)

    new 
fp=fopen(filename,"r");
    
ArrayClear(g_mapName);
    while (!
feof(fp))
    {
        
buff[0]='^0';
        
szText[0]='^0';
        
szTmp[0]='^0';
        
        
fgets(fpbuffcharsof(buff));

        
parse(buffszTextcharsof(szText), szTmpcharsof(szTmp));
        if(
szText[0] == '#')
        {
            
min str_to_num(szText[1])
            
max str_to_num(szTmp)
            continue
        }
        if(
min>pnum || max<pnum)
            continue

        if (
szText[0] != ';' &&
            
ValidMap(szText) &&
            !
equali(szTextg_lastMap) &&
            !
equali(szTextcurrentMap))
        {
            
ArrayPushString(g_mapNameszText);
            ++
g_mapNums;
        }
        
    } 
example maps file:
Code:
#1 15
dod_anzio
dod_avalanche
#3 4
dod_forest
dod_glider
dod_jagd
dod_kalt
#0 3
dod_vicenza
dod_zalec
__________________
Impossible is Nothing
Sylwester is offline
 



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:49.


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