Raised This Month: $ Target: $400
 0% 

Accessing game translations


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xaider
Senior Member
Join Date: Jan 2009
Location: Russia, Ryazan
Old 10-29-2010 , 09:07   Accessing game translations
Reply With Quote #1

Is there a native way to access game translations, such as #Cstrike_Weapon_Special_Func,#Cstrike_Name_Ch ange or so. If yes - how? If no - why?
__________________
Life don't forgive weaknesses..
xaider is offline
Send a message via ICQ to xaider Send a message via Skype™ to xaider
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 10-29-2010 , 14:40   Re: Accessing game translations
Reply With Quote #2

How do you mean? Hook or print?

Code:
#include <sourcemod>

public OnPluginStart()
{
    HookUserMessage(GetUserMessageId("TextMsg"), OnTextMsg, true);
    
    RegConsoleCmd("test_message", Command_TestMessage);
}

public Action:OnTextMsg(UserMsg:MsgId, Handle:hBf, const iPlayers[], iNumPlayer, bool:bReliable, bool:bInit)
{
    BfReadByte(hBf)
    
    decl String:szMsg[64];
    BfReadString(hBf, szMsg, sizeof(szMsg));
    
    if (StrEqual(szMsg, "#Cstrike_Weapon_Special_Func"))
    {
        return Plugin_Handled;
    }
    
    return Plugin_Continue;
}

public Action:Command_TestMessage(iClient, iArgs)
{
    if (iClient)
    {
        new Handle:hMsg = StartMessageOne("TextMsg", iClient);
        
        if (hMsg != INVALID_HANDLE)
        {
            BfWriteByte(hMsg, 3); // 3 = Print to chat 4 = Print center text
            BfWriteString(hMsg, "#Cstrike_Weapon_Special_Func");
            EndMessage();
        }
    }
}
Andersso is offline
xaider
Senior Member
Join Date: Jan 2009
Location: Russia, Ryazan
Old 10-29-2010 , 15:05   Re: Accessing game translations
Reply With Quote #3

Print.
__________________
Life don't forgive weaknesses..
xaider is offline
Send a message via ICQ to xaider Send a message via Skype™ to xaider
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 20:39.


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