View Single Post
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 11-20-2016 , 16:27   Re: about constants and strings...
Reply With Quote #4

The question should be "Why do something like that? Maplists are also a thing..."

As fo the code.. I would do something like
PHP Code:
new Handle:g_hBadMaps;
new 
Handle:g_hLegalMaps;

public 
OnPluginStart()
{
    
g_hBadMaps CreateArray(64);
    
g_hLegalMaps CreateArray(64);
    
    
PushArrayString(g_hBadMaps"de_dust2");
    
PushArrayString(g_hBadMaps"de_inferno");
    
PushArrayString(g_hBadMaps"de_train");
    
PushArrayString(g_hBadMaps"de_mirage");
    
    
PushArrayString(g_hLegalMaps"de_vertigo");
    
PushArrayString(g_hLegalMaps"de_dust");
    
PushArrayString(g_hLegalMaps"de_aztec");
    
PushArrayString(g_hLegalMaps"de_nuke");
}

public 
OnMapStart()
{
    new 
String:sMap[64];
    
GetCurrentMap(sMapsizeof(sMap));

    if (
FindStringInArray(g_hBadMapssMap) != -1) {
        new 
GetRandomInt(0GetArraySize(g_hLegalMaps));

        
GetArrayString(g_hLegalMapsisMapsizeof(sMap));
        
ForceChangeLevel(sMap);
    }

__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.

Last edited by KissLick; 11-20-2016 at 16:33.
KissLick is offline