Raised This Month: $ Target: $400
 0% 

Screen origin...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 09:14   Screen origin...
Reply With Quote #1

I made a forum for my server some days ago, so I made a little plugin which is supposed to write some info in the top right corner of the players screen.
And if they want to remove it they only have to say /remove...

But I need to know what origin to put it to make it show up in the top right corner.
Right now I just took the code from a xp plugin which shows it in the down left corner.

Heres my plugin:
Code:
#include <amxmodx> #include <amxmisc> new bool:g_adversite[33] public plugin_init() {     register_plugin("www.xuntric.tk adversite", "1.0", "XunTric")     register_clcmd("say /remove", "removeadd")     register_clcmd("say_team /remove", "removeadd") } public client_putinserver(id) {     g_adversite[id] = true     set_task(15.0, "hud", id) } public hud(id)     {     new MSG_TEXT     new HUD[51]     format(HUD, 60, "----------------------------^nI only have 3 admins + me^nAnd I need more!!^nJoin xuntric.tk^nAnd be active on the server^nThen you might get admin!!^n----------------------------^nSay /remove to remove this message^n----------------------------")     // ----------------------------     // I only have admins + me     // And I need more!!     // Join xuntric.tk     // And be active on the server     // Then you might get admin!!     // ----------------------------     // Say /remove to remove this message     // ----------------------------     message_begin(MSG_ONE, MSG_TEXT, {0,0,0}, id)     write_byte(0)     write_string(HUD)     message_end()     if(g_adversite[id] == true) {          set_task(15.0, "hud", id)     }     return }     public removeadd(id) {     client_print(id, print_chat, "[Adversite Text Removed]")     g_adversite[id] = false     remove_task(id)     return PLUGIN_HANDLED } public client_disconnect(id) {     g_adversite[id] = false }
XunTric is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 08-27-2005 , 10:54  
Reply With Quote #2

COORDINATES : (1, 2)


hope that helps
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 11:34  
Reply With Quote #3

So write_coord(1, 2)?
XunTric is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-27-2005 , 11:37  
Reply With Quote #4

Code:
#define TE_TEXTMESSAGE      29 // short 1.2.13 x (-1 = center) // short 1.2.13 y (-1 = center) // byte Effect 0 = fade in/fade out // 1 is flickery credits // 2 is write out (training room) // 4 bytes r,g,b,a color1   (text color) // 4 bytes r,g,b,a color2   (effect color) // ushort 8.8 fadein time // ushort 8.8  fadeout time // ushort 8.8 hold time // optional ushort 8.8 fxtime   (time the highlight lags behing the leading text in effect 2) // string text message      (512 chars max sz string)

I recommend you try to send this text message, I believe it supports quite a bit more customizing. (May be wrong)

Otherwise, you might want to try using a HUDMessage (Take a look at my easyinfo plugin, second page, unapproved) I believe EKS made a plugin to give you the coordinates of a HUD message.
pdoubleopdawg is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 11:48  
Reply With Quote #5

Cool, thanks.
Now I have this, but dont have any idea of how getting it to the other corner.
Code:
#include <amxmodx> #include <amxmisc> new bool:g_adversite[33] public plugin_init() {     register_plugin("www.xuntric.tk adversite", "1.0", "XunTric")     register_clcmd("say /remove", "removeadd")     register_clcmd("say_team /remove", "removeadd") } public client_putinserver(id) {     g_adversite[id] = true     set_task(15.0, "hud", id) } public hud(id)     {     new message[200]     set_hudmessage(0, 0, 255, 0.01, 0.29, 0, 6.0, 2.0, 0.1, 0.2, 4)     format(message, 199, "----------------------------^nI only have 3 admins + me^nAnd I need more!!^nJoin xuntric.tk^nAnd be active on the server^nThen you might get admin!!^n----------------------------^nTo remove this message:^nsay /remove^n----------------------------")     show_hudmessage(id, message)     if(g_adversite[id] == true) {          set_task(15.0, "hud", id)     }     return }     public removeadd(id) {     client_print(id, print_chat, "[Adversite Text Removed]")     g_adversite[id] = false     remove_task(id)     return PLUGIN_HANDLED } public client_disconnect(id) {     g_adversite[id] = false }
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 15:52  
Reply With Quote #6

Code:
set_hudmessage(0, 0, 255, 0.0, 1.0, 0, 6.0, 2.0, 0.1, 0.2, 4)

X and Y are 0.0 to 1.0, 0.0 being the left (or top) and 1.0 being the right (or bottom).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 16:40  
Reply With Quote #7

Actually, I liked the position I found in dawg's plugin best, but thanks anyway avalanche

Just got another question.
Would it be possible to make the background of the text dark?
Because sometimes its very hard to read.
And I made this cool flash effect so it changes color every second.
So it would look better with dark background.
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 17:20  
Reply With Quote #8

You can't change the background color of the text, just the color of the letters.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 17:31  
Reply With Quote #9

Yeh but would it some kind of way be possible to make it dark behind the text?
Like just place a big black square behind it lol.
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 18:32  
Reply With Quote #10

You can't draw shapes on a client's screen with AMXx. Just use a more readable text color.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 14:24.


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