Raised This Month: $ Target: $400
 0% 

translate miniag half life 1


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-10-2016 , 11:54   Re: translate miniag half life 1
Reply With Quote #5

He wants to replace Hook Message text in the screen language (English to Spanish)

The original text in the game

Half-Life
Adrenaline Gamer




The image at the top is an attempt to do so but he finds it difficult to determine the message


Here are some attempts

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

#pragma ctrlchar '\'

#define AUTHOR "Lev"
#define PLUGIN "test"
#define VERSION "0.0"

public plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR);
   
register_srvcmd("test""cmd_test");
}

public 
cmd_test(id)
{
server_print("------------");
   new 
text[256];
   
copy(textcharsmax(text), "Match Player1 vs Player2 in 9 seconds!");

   new 
len strlen(text);
server_print("len: %i"len);

   
// Test if string do match what we expect
   
if (contain(text"Match ") != || len 15)
      return;

   
// Search for last space char
   
new posSecondsText len 1;
   while (
posSecondsText && text[posSecondsText] != ' 'posSecondsText--;
   if (
posSecondsText == 0)
      return;
server_print("posSecondsText 1: %i"posSecondsText);

   if (!
equal(text[posSecondsText], " seconds!"))
      return;

   
// Cut " seconds!" text
   
text[posSecondsText] = 0;

   
// Search for last space char
   
while (posSecondsText && text[posSecondsText] != ' 'posSecondsText--;
   if (
posSecondsText == 0)
      return;
server_print("posSecondsText 2: %i"posSecondsText);

   
// Get seconds number
   
new seconds str_to_num(text[posSecondsText]);
server_print("seconds: %i"seconds);

   
// Cut seconds number
   
text[posSecondsText] = 0;

   if (
posSecondsText || !equal(text[posSecondsText 3], " in"))
      return;

   
// Cut " in" text
   
text[posSecondsText 3] = 0;

   
// Get player names
   
new names[256];
   
copy (namescharsmax(names), text[6]);

   
// Format result string
   
new outText[256];
   
format(outTextcharsmax(outText), "Duelo entre %s en %i segundos!!!"namesseconds);
server_print("result: %s"outText);

Quote:
test
------------
len: 38
posSecondsText 1: 29
posSecondsText 2: 27
seconds: 9
result: Duelo entre Player1 vs Player2 en 9 segundos!!!
Note :
The source of the message in client.dll not plugin .
__________________

Last edited by abdobiskra; 01-10-2016 at 11:56.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
 



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 09:28.


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