Raised This Month: $ Target: $400
 0% 

Hud message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
made.tn
BANNED
Join Date: Nov 2011
Old 11-23-2011 , 06:15   Hud message
Reply With Quote #1

I'm new in this forum

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "hudmessage"
#define VERSION "1.0"
#define AUTHOR "made.tn"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say hi""hi_msg")
    
register_clcmd("say by""by_msg")
    
register_clcmd("say plugin""plg_msg")
    
register_clcmd("say amxx""amx_msg")
}



public 
hi_msg(id)
{
    
set_hudmessage(00255, -1.00.3503.01.21.31.44)
    
show_hudmessage(id"Hello client have fun ;)")
    return 
PLUGIN_CONTINUE
}


public 
by_msg(id)
{
    
set_hudmessage(25500, -1.00.3503.01.21.31.44)
    
show_hudmessage(id"by arrive tomorrow :)")
    return 
PLUGIN_CONTINUE
}

public 
plg_msg(id)
{
    
set_hudmessage(02550, -1.00.3503.01.21.31.44)
    
show_hudmessage(id"plugin made by made.tn")
    return 
PLUGIN_CONTINUE
}

public 
amx_msg(id)
{
    
set_hudmessage(00255, -1.00.3503.01.21.31.44)
    
show_hudmessage(id"Go to the official website AMXMODX.ORG")
    return 
PLUGIN_CONTINUE

Attached Files
File Type: sma Get Plugin or Get Source (hudmsg.sma - 582 views - 1.2 KB)

Last edited by made.tn; 11-26-2011 at 14:18.
made.tn is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-23-2011 , 06:35   Re: Headshot hudmessage
Reply With Quote #2

PHP Code:
register_event("DeathMsg""eDeath""a""1>0""2>0""3=1"
PHP Code:
public eDeath(id) {
      
set_hudmessage(25500, -1.00.3503.01.21.31.44)
      
show_hudmessage(id"Headshot!")

__________________

Last edited by Napoleon_be; 11-23-2011 at 06:35.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fl0werD
Senior Member
Join Date: May 2011
Old 11-23-2011 , 06:35   Re: Headshot hudmessage
Reply With Quote #3

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

public plugin_init()
    
RegisterHam(Ham_Killed"player""PlayerKilledPost"1)

public 
PlayerKilledPost(victimattackershouldgib)
{
    if(!
is_user_connected(attacker))
        return;

    if(
victim == attacker)
        return;

    if(
get_pdata_int(victim75) != HIT_HEAD)
        return;

    
set_hudmessage(2001000, -1.00.3003.03.00.150.151)
    
show_hudmessage(attacker"::HEADSHOT::")

fl0werD is offline
Send a message via ICQ to fl0werD
made.tn
BANNED
Join Date: Nov 2011
Old 11-23-2011 , 06:53   Re: Headshot hudmessage
Reply With Quote #4

thanks all
made.tn is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 11-23-2011 , 07:00   Re: Headshot hudmessage
Reply With Quote #5

Quote:
Originally Posted by fl0werD View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init()
    
RegisterHam(Ham_Killed"player""PlayerKilledPost"1)

public 
PlayerKilledPost(victimattackershouldgib)
{
    if(!
is_user_connected(attacker))
        return;

    if(
victim == attacker)
        return;

    if(
get_pdata_int(victim75) != HIT_HEAD)
        return;

    
set_hudmessage(2001000, -1.00.3003.03.00.150.151)
    
show_hudmessage(attacker"::HEADSHOT::")

Why include ham and fakemeta for something you can do in a much simpler way, with lot less module communication?
Erox902 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-23-2011 , 07:02   Re: Headshot hudmessage
Reply With Quote #6

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
register_event("DeathMsg""eDeath""a"
PHP Code:
public eDeath(id) {
      
set_hudmessage(25500, -1.00.3503.01.21.31.44)
      
show_hudmessage(id"Headshot!")

id equal 0 in your case.

Code:
public eDeath(id) {       new attacker = read_data( 1 )             if( read_data( 3 ) )       {             set_hudmessage(255, 0, 0, -1.0, 0.35, 0, 3.0, 1.2, 1.3, 1.4, 4)             show_hudmessage(attacker, "Headshot!")       } }

Last edited by Devil259; 11-23-2011 at 07:04.
Devil259 is offline
made.tn
BANNED
Join Date: Nov 2011
Old 11-23-2011 , 07:18   Re: Headshot hudmessage
Reply With Quote #7

thanks also to Devil259 and Erox902
made.tn is offline
made.tn
BANNED
Join Date: Nov 2011
Old 11-23-2011 , 07:21   Re: Headshot hudmessage
Reply With Quote #8

Quote:
register_event("DeathMsg", "eDeath", "a")
what's the "a" ???
made.tn is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-23-2011 , 07:48   Re: Headshot hudmessage
Reply With Quote #9

EDIT your post instead of re-posting.

http://www.amxmodx.org/funcwiki.php?...vent&go=search

Quote:
register_event ( const event[], const function[], const flags[], [ cond=[], ... ] )

event is a message, such as "DeathMsg", "Damage", et cetera.

function is the name of a public function which will be called on this event.

flags is a combination of flags that determine if this event is forwarded:
"a" - Global Event
"b" - Event sent to a single target
"c" - Send only once when repeated to other players
"d" - Only if sent to a dead player
"e" - Only if sent to an alive player
Devil259 is offline
raghunarnindi001
Member
Join Date: Apr 2011
Old 11-23-2011 , 08:06   Re: Headshot hudmessage
Reply With Quote #10

I think you must also use register_event( "ResetHUD" , <functionname> , flags ,......,)

"a" - Global Event
"b" - Event sent to a single target
"c" - Send only once when repeated to other players
"d" - Only if sent to a dead player
"e" - Only if sent to an alive player

Last edited by raghunarnindi001; 11-23-2011 at 08:06.
raghunarnindi001 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 08:31.


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