core/smn_lang.cpp
author David Anderson <dvander@alliedmods.net>
Thu Feb 08 01:11:45 2007 +0000 (2007-02-08)
changeset 453 7611078f11cd
parent 396 c0af59ee9ca4
child 591 86e97f3eda1f
permissions -rw-r--r--
added gameevents to the publicly available interfaces
     1 /**
     2  * ===============================================================
     3  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     4  * ===============================================================
     5  *
     6  * This file is not open source and may not be copied without explicit
     7  * written permission of AlliedModders LLC.  This file may not be redistributed 
     8  * in whole or significant part.
     9  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    10  *
    11  * Version: $Id$
    12  */
    13 
    14 #include "PluginSys.h"
    15 #include "CTranslator.h"
    16 
    17 static cell_t sm_LoadTranslations(IPluginContext *pCtx, const cell_t *params)
    18 {
    19 	char *filename;
    20 	unsigned int index;
    21 	CPlugin *pl = (CPlugin *)g_PluginSys.FindPluginByContext(pCtx->GetContext());
    22 
    23 	pCtx->LocalToString(params[1], &filename);
    24 
    25 	index = g_Translator.FindOrAddPhraseFile(filename);
    26 	pl->AddLangFile(index);
    27 
    28 	return 1;
    29 }
    30 
    31 REGISTER_NATIVES(langNativeS)
    32 {
    33 	{"LoadTranslations",			sm_LoadTranslations},
    34 	{NULL,							NULL},
    35 };