Raised This Month: $ Target: $400
 0% 

message appears when the player is killed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-14-2014 , 04:42   Re: message appears when the player is killed
Reply With Quote #5

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

public plugin_init( ) {
    
register_plugin"Death Message""1.0""BuckShot" )
    
RegisterHamHam_Killed"player""Fwd_Ham_Killed_Post")
}

public 
Fwd_Ham_Killed_PostiVictimiAttacker ) {
    new 
szAttackername32 ]
    new 
szVictimname32 ]
    
get_user_nameiAttackerszAttackernamecharsmaxszAttackername ) )
    
get_user_nameiVictimszVictimnamecharsmaxszVictimname ) )
    
client_print0print_chat"%s was killed by %s"szVictimnameszAttackername )

Example. Will display a message saying "Player was killed by player" when a player dies.
why use hamsandwich when you can use DeatMsg directly ?

This code will show an meesage to a victim and one msg to the victim

if headshot the message of the victim will be :

Code:
You have been headshoted !
if is not headshot the meesage of the victim will be :

Code:
You have been normal killed (without headshot)
if is headshot the message of the attacker will be :

Code:
You give headshot to other player
if is not headshot the meesage of the attacker will be :

Code:
You normal kill the player (without headshot)
The source code :

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_event("DeathMsg""death_msg_function""a");
}

public 
death_msg_function()
{
    new 
victim read_data);
    new 
attacker read_data);
    new 
hs read_data);

    if(
hs)
    {
        
client_print(victim print_chat"You have been headshoted !")

        
client_print(attacker print_chat"You give headshot to other player");
    }

    else
    {
        
client_print(victim print_chat"You have been normal killed (without headshot) ");

        
client_print(attacker print_chat"You normal kill the player (without headshot) ");    
    }

swapped is offline
 



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 17:52.


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