--
[ Picked text/plain from multipart/alternative ]
Hi emiel,

For SourceForts, I use this : (i use hl2mp sdk)
In hl2mp_client.cpp :

//=========================================================
// instantiate the proper game rules object
//=========================================================
void InstallGameRules()
{
       std::string mapName = STRING( gpGlobals->mapname );

       mapName = mapName.substr( 0, 3 );

       if (mapName == "sf_") // Classic SourceForts CTF
       {
              CreateGameRulesObject( "CSFCTFGamerules" );
       }
       else if (mapName == "cr_") // Core Run map
       {
              CreateGameRulesObject( "CSFCRGamerules" );
       }
       else if (mapName == "cq_") // Conquest map
       {
              CreateGameRulesObject( "CHL2MPRules" );
       }
       else
              CreateGameRulesObject( "CSFCTFGamerules" );
}

InstallGamerules is already called automatically. Thought (note to valve) it
seems client side the networktable is not updated for gamerules object.So
 when it's creating a new one server side, client side it remains the
old one. So you'll have to make the samefunction client side
in C_World::Precache( ) and use

char mapN[64];
V_FileBase( engine->GetLevelName( ), mapN, 64 );

std::string mapName = mapN;
mapName = mapName.substr( 0, 3 );

instead of std::string mapName = STRING( gpGlobals->mapname );
I hope I helped you.

On 4/8/07, Emiel Regis <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am doing this system, where with use of external MapInfo files you can
> set some fixed values, like gametype the map is created for. I want to
> make it so that if the gametype doesn't match, the map won't show in the
> browser and will not load, giving "Wrong gametype" and exit to main menu
> effect. Yet, atm I tried finding appropriate place and only one I found
> was LevelInit(), but putting this stuff there only leads to crashes when
> loading unsupported maps. Could someone give me a helping hand and point
> to where map browser is implemented?
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to