Raised This Month: $ Target: $400
 0% 

Different Menu's for different maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 08-21-2013 , 11:07   Re: Different Menu's for different maps
Reply With Quote #1

PHP Code:

#define maxmaps 3
new const mapnames[maxmaps][48] =
{
    
"1hp_he",
    
"awp_",
    
"ka_"
}

new const 
mapnames_usecontaini[maxmaps] =
{
    
0,
    
1,
    
1
}

new 
ismap
public plugin_init()
{
    
check_map()
}

check_map()
{
    new 
map[48], a
    get_mapname
(mapcharsmax(map))
    for( 
0maxmapsa++ )
    {
        if(!
mapnames_usecontaini[a])
        {
            if(
equali(map,mapnames[a]))
            {
                
ismap a
                
break
            }
            continue
        }
        
        if(
containi(map,mapnames[a]) != -1)
        {
            
ismap a
            
break
        }
    }
}

public 
yourfunc()
{
    switch(
ismap)
    {
        case 
0:
        {
            
// map is 1hp_he
        
}
        case 
1:
        {
            
// mapname contains awp_
        
}
        case 
2:
        {
            
// mapname contains ka_
        
}
    }

.Dare Devil. 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 15:59.


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