Raised This Month: $ Target: $400
 0% 

Center the text in a hud message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Moe
Member
Join Date: Dec 2009
Location: GTA
Old 07-17-2010 , 18:29   Center the text in a hud message
Reply With Quote #1

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
Moe is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-17-2010 , 18:35   Re: Center the text in a hud message
Reply With Quote #2

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? 
PattyBiena is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-18-2010 , 00:02   Re: Center the text in a hud message
Reply With Quote #3

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.
__________________
Hunter-Digital is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-18-2010 , 08:40   Re: Center the text in a hud message
Reply With Quote #4

Quote:
Originally Posted by Hunter-Digital View Post
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.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-18-2010 , 19:29   Re: Center the text in a hud message
Reply With Quote #5

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.
__________________

Last edited by Hunter-Digital; 07-18-2010 at 19:33.
Hunter-Digital is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-18-2010 , 20:19   Re: Center the text in a hud message
Reply With Quote #6

If you are using the amxx studio editor, simply use the hud generator and place the text where ever you want.
SpeeDeeR is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 07-18-2010 , 22:58   Re: Center the text in a hud message
Reply With Quote #7

Use hudmessage generator from amx studio, its easy to use!
__________________
ILUSION is offline
Moe
Member
Join Date: Dec 2009
Location: GTA
Old 07-19-2010 , 13:19   Re: Center the text in a hud message
Reply With Quote #8

Thats a lot of quick replies thats guys

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?
Moe is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 07-19-2010 , 14:14   Re: Center the text in a hud message
Reply With Quote #9

Not -0.30, but -0.1
__________________
Hi.
Kreation is offline
Moe
Member
Join Date: Dec 2009
Location: GTA
Old 07-19-2010 , 14:50   Re: Center the text in a hud message
Reply With Quote #10

actually I fixed it by making it -1.0 I dont know why it stayed in the middle but it did 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!
Moe 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 07:16.


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