AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   translate miniag half life 1 (https://forums.alliedmods.net/showthread.php?t=277492)

eseqiiel 01-09-2016 22:25

translate miniag half life 1
 
Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#define VERSION "0.2a"

new g_SyncObj1;

public plugin_init()
{
  register_plugin("MiniAG TimerFix", VERSION, "LetiLetiLepestok");
  register_message(SVC_TEMPENTITY, "HookTempentity");
  g_SyncObj1 = CreateHudSyncObj();

}

public HookTempentity()
{
  if (get_msg_arg_int(1) != TE_TEXTMESSAGE)
      return PLUGIN_CONTINUE;

  static szMessage[512];

 
  new x = get_msg_arg_int(3);
  new y = get_msg_arg_int(4);

  if (x == 4096 && y == 81)
      return PLUGIN_HANDLED;

  if (x == 2457 && y == 4096)
 
  {
      get_msg_arg_string(18, szMessage, charsmax(szMessage));
     
      //client_print(0, print_chat, "= %s, [%d] * [%d] * [%d]", szMessage, get_msg_arg_int(14), get_msg_arg_int(15), get_msg_arg_int(16));
      //Modify the message = Match "Player" vs "Player" in "time" seconds!
      set_hudmessage(0, 255, 0, -1.0, 0.45, 0, 6.0, 12.0)

      ShowSyncHudMsg(0, g_SyncObj1, "Duelo entre (%s) versus (%s) en (%s) segundos!!!", szMessage);
     
      return PLUGIN_HANDLED; 
  }

  return PLUGIN_CONTINUE;
}

http://www.subeimagenes.com/img/sin-titulo-1477174.jpg

//Modify the message = Match "Player" vs "Player" in "time" seconds!

OciXCrom 01-10-2016 07:37

Re: translate miniag half life 1
 
What's so difficult?!

eseqiiel 01-10-2016 09:43

Re: translate miniag half life 1
 
Quote:

Originally Posted by OciXCrom (Post 2381902)
What's so difficult?!

I can not replace

//Modify the message = Match "Player" vs "Player" in "time" seconds!


for

ShowSyncHudMsg(0, g_SyncObj1, "Duelo entre (%s) versus (%s) en (%s) segundos!!!", szMessage);

redivcram 01-10-2016 11:37

Re: translate miniag half life 1
 
Why can't you?

abdobiskra 01-10-2016 11:54

Re: translate miniag half life 1
 
He wants to replace Hook Message text in the screen language (English to Spanish)

The original text in the game

Half-Life
Adrenaline Gamer

http://aghl.ru/forum/download/file.php?id=3497&t=1


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 .

eseqiiel 01-10-2016 19:09

Re: translate miniag half life 1
 
nobody helps

siriusmd99 01-11-2016 09:29

Re: translate miniag half life 1
 
ShowSyncHudMsg(0, g_SyncObj1, "%s", szMessage);

Thats it

abdobiskra 01-11-2016 11:05

Re: translate miniag half life 1
 
Quote:

Originally Posted by siriusmd99 (Post 2382207)
ShowSyncHudMsg(0, g_SyncObj1, "%s", szMessage);

Thats it

This way you display the same message

He want replace this all message

ex :Match %s vs %s in %d seconds

to >

Duelo entre %s vs %s en %d segundos

OciXCrom 01-11-2016 13:18

Re: translate miniag half life 1
 
He just need to use his mind a little.

eseqiiel 01-11-2016 13:46

Re: translate miniag half life 1
 
Thanks was what I needed OciXCrom


All times are GMT -4. The time now is 09:28.

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