Raised This Month: $ Target: $400
 0% 

Can't find function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sader
Junior Member
Join Date: Aug 2011
Old 08-12-2011 , 16:56   Can't find function
Reply With Quote #1

Hi
What is function to check map type? DEFUSE, VIP ?
Looking through al funcs-list cannot find it.
sader is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2011 , 17:09   Re: Can't find function
Reply With Quote #2

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 but I don't really know what entities are required for each game type, so you'll have to research on that.
__________________
Hunter-Digital is offline
sader
Junior Member
Join Date: Aug 2011
Old 08-12-2011 , 17:17   Re: Can't find function
Reply With Quote #3

Ok.. Thanks. Strange that there is no such function but at least you gived me good direction
sader is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-12-2011 , 17:54   Re: Can't find function
Reply With Quote #4

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;
    }
}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sader
Junior Member
Join Date: Aug 2011
Old 08-12-2011 , 19:51   Re: Can't find function
Reply With Quote #5

Thak you for those class names. I made what I wanted to make with fakemeta, thanks.
sader 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 03:29.


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