Raised This Month: $ Target: $400
 0% 

print_center help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 08-05-2009 , 06:46   print_center help
Reply With Quote #1

HTML Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Messag3"
#define VERSION "0.1"
#define AUTHOR "80T"
 
public plugin_init()
{
 register_plugin(PLUGIN, VERSION, AUTHOR)
 register_event("ResetHUD", "event_spawn", "b")
}
public event_spawn(id)
{
 client_print(id, print_center, "M^ne^ns^ns^na^ng^n3")
 return PLUGIN_CONTINUE
}
 
 
I don't know what is wrong in this code but I can't get a "print_center" message to be displayed VERTICAL

I just want to make a verry simple plugin that will display a vertical center message to every player when he spawns...
Costin83 is offline
Send a message via Yahoo to Costin83
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2009 , 07:17   Re: print_center help
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Spawn Message"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)
}

public 
Player_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        
client_print_center(id"^nM^ne^ns^ns^na^ng^n3")
    }
}

client_print_center(idmsg[], any:...)
{
    static 
szMsg[128]
    
vformat(szMsgcharsmax(szMsg), msg3)
    
engfunc(EngFunc_ClientPrintfid1szMsg)

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-05-2009 at 14:42.
ConnorMcLeod is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-05-2009 , 09:30   Re: print_center help
Reply With Quote #3

Code:
engclient_print(id, engprint_center, "M^ne^ns^ns^na^ng^n3");
__________________
hleV is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 08-05-2009 , 10:50   Re: print_center help
Reply With Quote #4

Wow! Those was prety fast replyes.

Thank you both

+K

Annyways.... I don't see the HAM_GivePlayerBeer function...
Costin83 is offline
Send a message via Yahoo to Costin83
Old 08-05-2009, 13:29
IneedHelp
This message has been deleted by IneedHelp. Reason: nvm~
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-05-2009 , 14:35   Re: print_center help
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define VERSION "0.0.1" public plugin_init() {     register_plugin("Spawn Message", VERSION, "ConnorMcLeod")     RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1) } public Player_Spawn_Post( id ) {     if( is_user_alive(id) )     {         client_print_center(id, "^nM^ne^ns^ns^na^ng^n3")     } } client_print_center(id, msg[], any:...) {     static szMsg[128]     vformat(szMsg, charsmax(szMsg), msg, 3)     engfunc(EngFunc_ClientPrintf, id, 1, szMsg) }
Small bug.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2009 , 14:42   Re: print_center help
Reply With Quote #6

Ops, fixed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 08-05-2009 , 15:03   Re: print_center help
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Small bug.
What was the difference ?
Why was it necessary to be an "^n" in front ?
Costin83 is offline
Send a message via Yahoo to Costin83
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-05-2009 , 15:08   Re: print_center help
Reply With Quote #8

Quote:
Originally Posted by Costin83 View Post
What was the difference ?
Why was it necessary to be an "^n" in front ?
He used the function with an invalid argument.
It was something like:
PHP Code:
client_print_center(idprint_center"message....")
// where it should be
client_print_center(id"message...."
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2009 , 15:09   Re: print_center help
Reply With Quote #9

Quote:
Originally Posted by Costin83 View Post
Why was it necessary to be an "^n" in front ?
That one let the game display its own centered messages.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 08-06-2009 , 15:40   Re: print_center help
Reply With Quote #10

Ok so now I understand thanks for explanations.
Costin83 is offline
Send a message via Yahoo to Costin83
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 18:24.


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