AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can't find function (https://forums.alliedmods.net/showthread.php?t=164533)

sader 08-12-2011 16:56

Can't find function
 
Hi
What is function to check map type? DEFUSE, VIP ?
Looking through al funcs-list cannot find it.

Hunter-Digital 08-12-2011 17:09

Re: Can't find function
 
There isn't such function (AFAIK), you'll need to detect that yourself.

The easiest but can be unaccurate way is to get the prefix of the map, use get_mapname() in a 3 cell array and compare to "de", "cs", "as", "es", "fy", etc.

A more accurate way is to get the map's game entities and decide what game modes the map contains, since a map can have hostages, vip, bomb and terrorist escape all in one, it's quite hard to include all of those into the map's name :lol: but I don't really know what entities are required for each game type, so you'll have to research on that.

sader 08-12-2011 17:17

Re: Can't find function
 
Ok.. Thanks. Strange that there is no such function :) but at least you gived me good direction

ConnorMcLeod 08-12-2011 17:54

Re: Can't find function
 
From cs-sdk :

If you need some pawn "conversion", just ask.

Code:

void CHalfLifeMultiplay::CheckMapConditions()
{
    if ( UTIL_FindEntityByClassname( NULL, "func_bomb_target" ) )
    {
        m_bMapHasBombTarget = true;
        m_bMapHasBombZone  = true;
    }
    else if ( UTIL_FindEntityByClassname( NULL, "info_bomb_target" ) )
    {
        m_bMapHasBombTarget = true;
    }
    else
    {
        m_bMapHasBombTarget = false;
        m_bMapHasBombZone  = false;
    }
 
    if ( UTIL_FindEntityByClassname( NULL, "func_hostage_rescue" ) )
    {
        m_bMapHasRescueZone = true;
    }
    else
    {
        m_bMapHasRescueZone = false;
    }
   
    if ( UTIL_FindEntityByClassname( NULL, "func_buyzone" ) )
    {
        m_bMapHasBuyZone = true;
    }
    else
    {
        m_bMapHasBuyZone = false;
    }
 
    if ( UTIL_FindEntityByClassname( NULL, "func_escapezone" ) )
    {
        m_bMapHasEscapeZone = true;
    }
    else
    {
        m_bMapHasEscapeZone = false;
    }
 
    if ( UTIL_FindEntityByClassname( NULL, "func_vip_safetyzone" ) )
    {
        m_iMapHasVIPSafetyZone = 1;
    }
    else
    {
        m_iMapHasVIPSafetyZone = 2;
    }
}


sader 08-12-2011 19:51

Re: Can't find function
 
Thak you for those class names. I made what I wanted to make with fakemeta, thanks.


All times are GMT -4. The time now is 03:29.

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