Raised This Month: $ Target: $400
 0% 

translate miniag half life 1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eseqiiel
Junior Member
Join Date: Jan 2016
Old 01-09-2016 , 22:25   translate miniag half life 1
Reply With Quote #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;
}


//Modify the message = Match "Player" vs "Player" in "time" seconds!
eseqiiel is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-10-2016 , 07:37   Re: translate miniag half life 1
Reply With Quote #2

What's so difficult?!
OciXCrom is offline
Send a message via Skype™ to OciXCrom
eseqiiel
Junior Member
Join Date: Jan 2016
Old 01-10-2016 , 09:43   Re: translate miniag half life 1
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
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);
eseqiiel is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 01-10-2016 , 11:37   Re: translate miniag half life 1
Reply With Quote #4

Why can't you?
redivcram is offline
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
eseqiiel
Junior Member
Join Date: Jan 2016
Old 01-10-2016 , 19:09   Re: translate miniag half life 1
Reply With Quote #6

nobody helps
eseqiiel is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-11-2016 , 09:29   Re: translate miniag half life 1
Reply With Quote #7

ShowSyncHudMsg(0, g_SyncObj1, "%s", szMessage);

Thats it
siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-11-2016 , 11:05   Re: translate miniag half life 1
Reply With Quote #8

Quote:
Originally Posted by siriusmd99 View Post
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
__________________

Last edited by abdobiskra; 01-11-2016 at 11:07.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-11-2016 , 13:18   Re: translate miniag half life 1
Reply With Quote #9

He just need to use his mind a little.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
eseqiiel
Junior Member
Join Date: Jan 2016
Old 01-11-2016 , 13:46   Re: translate miniag half life 1
Reply With Quote #10

Thanks was what I needed OciXCrom

Last edited by eseqiiel; 01-18-2016 at 12:41.
eseqiiel is offline
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 09:29.


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