AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Center the text in a hud message (https://forums.alliedmods.net/showthread.php?t=132685)

Moe 07-17-2010 18:29

Center the text in a hud message
 
I'm making a plugin and its all done I tested it on a server and everything works great except that the text isn't centered on the hud message. Its a small insignificant problem yes I know but it really degrades the look of it, in my opinion at least.

the way it is :
Hi My Name Is
MoE

the way I would like it:
Hi My Name Is
MoE

PattyBiena 07-17-2010 18:35

Re: Center the text in a hud message
 
That is automatic.

Example:

PHP Code:

set_hudmessage(255255255, -1.0, -1.0)
show_hudmessage(0"Hello I'm Fine^nAnd You?"

Showed:
PHP Code:

     Hello I'm Fine
       And You? 


Hunter-Digital 07-18-2010 00:02

Re: Center the text in a hud message
 
Positive values on X aligns the text to left, negative values aligns text to right (may be the other way around, test) and -1.0 aligns text to center.

GXLZPGX 07-18-2010 08:40

Re: Center the text in a hud message
 
Quote:

Originally Posted by Hunter-Digital (Post 1242971)
Positive values on X aligns the text to left, negative values aligns text to right (may be the other way around, test) and -1.0 aligns text to center.

Yes, its the opposite I believe. Think of the monitor as a grid or plot map. It has an X axis and a Y axis obviously. If you do it positive on the x axis, it goes to the right, negative goes to the left. With the Y axis, positive goes up, negative goes down.

Hunter-Digital 07-18-2010 19:29

Re: Center the text in a hud message
 
No, I am talking about text alignment, not positioning!

Ex:
Code:

X = 0.5
              Just one small
              test

X = -0.5
              Just one small
                        test

X = -1.0
              Just one small
                  test

Range is 0.0 to 1.0, X 0 is left and Y 0 is top, if you negate those values, they go to the other side of screen... Y would be from bottom and X would be from right.
While -1.0 is center... I didn't test -0.0 btw.

SpeeDeeR 07-18-2010 20:19

Re: Center the text in a hud message
 
If you are using the amxx studio editor, simply use the hud generator and place the text where ever you want.

ILUSION 07-18-2010 22:58

Re: Center the text in a hud message
 
Use hudmessage generator from amx studio, its easy to use!

Moe 07-19-2010 13:19

Re: Center the text in a hud message
 
Thats a lot of quick replies thats guys :D

well what I have now is

PHP Code:

set_hudmessage(255000.300.006.012.0);
 
show_hudmessage(0"%s^n Server IP : %s"hostnameserverip); 

and it always comes out alligned to the left so to fix it I would just have to do -0.30 ? Thats a sad mistake xD

May I ask other questions here or should open a new topic for each of them?

Kreation 07-19-2010 14:14

Re: Center the text in a hud message
 
Not -0.30, but -0.1

Moe 07-19-2010 14:50

Re: Center the text in a hud message
 
actually I fixed it by making it -1.0 I dont know why it stayed in the middle but it did :D thanks for the help guys!!

My other question is I wanted to do something with objectives I had it
PHP Code:

new objective;
if (
team ct)
{
          if (
mapname "de_whatever")
          {
          
objective "Kill The Ts";
          }
          else if(
mapname "cs_whatever" || "cs_allied")
          {
          
objective "Rescue Hostages"
          
}


I also had one for Ts & VIPs. I always got errors saying it needs to be an array. I've tried many different arrays but they never work. I've done [10] each one would be a different objective and [32] because none of them were longer then 31 characters. None of them worked. So please some advice on what to do! :D


All times are GMT -4. The time now is 07:16.

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