Raised This Month: $51 Target: $400
 12% 

hi need code..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkT1
Member
Join Date: Oct 2011
Old 03-25-2012 , 07:55   hi need code..
Reply With Quote #1

i need that someone kill with hg its show on chat

"name kill with hg name"

somethink like this^

and with knife

its show

"name JUST KNIFED name"

thanks....

Last edited by DarkT1; 03-25-2012 at 09:37.
DarkT1 is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 03-25-2012 , 15:19   Re: hi need code..
Reply With Quote #2

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Request", "0.1", "Ex1ne")     register_event("DeathMsg", "Event_DeathMessage", "a") } public Event_DeathMessage() {     new iKiller = read_data(1)     new iVictim = read_data(2)     new Weapon[32], name[2][32]     read_data(4, Weapon, sizeof(Weapon) -1)     get_user_name(iKiller, name[0], sizeof(name[]) -1)     get_user_name(iVictim, name[1], sizeof(name[]) -1)     if(equali(Weapon, "grenade"))     {         client_print(0, print_chat, "%s killed %s with a grenade!", name[0], name[1])         return PLUGIN_HANDLED     }     else if(equali(Weapon, "knife"))     {         client_print(0, print_chat, "%s just knifed %s", name[0], name[1])         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
__________________
Ex1ne is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-26-2012 , 07:57   Re: hi need code..
Reply With Quote #3

love u man!
DarkT1 is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-27-2012 , 04:20   Re: hi need code..
Reply With Quote #4

but when somebody kill himself with grenade its type

dH_MaN killed dH_MaN with a grenade

can u fix that it type like this? when somebody killed him self with HG?

dH_MaN killed self with grenade!
DarkT1 is offline
CreePs
Member
Join Date: Mar 2011
Old 03-27-2012 , 05:32   Re: hi need code..
Reply With Quote #5

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

public plugin_init() {
    register_plugin("Request", "0.1", "Ex1ne")
    register_event("DeathMsg", "Event_DeathMessage", "a")
}
public Event_DeathMessage()
{
    new iKiller = read_data(1)
    new iVictim = read_data(2)
    new Weapon[32], name[2][32]
    read_data(4, Weapon, sizeof(Weapon) -1)
    get_user_name(iKiller, name[0], sizeof(name[]) -1)
    get_user_name(iVictim, name[1], sizeof(name[]) -1)
    if(equali(Weapon, "grenade"))
    {
        if( iKiller == iVictim )
        {
            client_print(0, print_chat, "%s killed self with grenade!", name[0])
            return PLUGIN_HANDLED;
        }
        client_print(0, print_chat, "%s killed %s with a grenade!", name[0], name[1])
        return PLUGIN_HANDLED
    }
    else if(equali(Weapon, "knife"))
    {
        client_print(0, print_chat, "%s just knifed %s", name[0], name[1])
        return PLUGIN_HANDLED
    }
    return PLUGIN_CONTINUE
}
__________________
My Plugin's:
CreePs is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-27-2012 , 06:26   Re: hi need code..
Reply With Quote #6

^ dont work its show same
DarkT1 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-27-2012 , 09:48   Re: hi need code..
Reply With Quote #7

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

public plugin_init() {
    
register_plugin("Request""0.1""Ex1ne")
    
register_event("DeathMsg""Event_DeathMessage""a")
}
public 
Event_DeathMessage()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
Weapon[32], name[2][32]
    
read_data(4Weaponsizeof(Weapon) -1)
    
get_user_name(iKillername[0], sizeof(name[]) -1)
    
get_user_name(iVictimname[1], sizeof(name[]) -1)
    if(
equali(Weapon"grenade"))
    {
        if( 
cs_get_user_team(iKiller) == cs_get_user_team(iVictim) )
        {
            
client_print(0print_chat"%s killed self with grenade!"name[0])
            return 
PLUGIN_HANDLED;
        }
        
client_print(0print_chat"%s killed %s with a grenade!"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equali(Weapon"knife"))
    {
        
client_print(0print_chat"%s just knifed %s"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    
    if(
iKiller == 0) {
        
client_print(0print_chat"%s commited suicide!"name[0])
    }
    return 
PLUGIN_CONTINUE

Make sure your module cstrike is enabled.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-27-2012 , 09:51   Re: hi need code..
Reply With Quote #8

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
        if( cs_get_user_team(iKiller) == cs_get_user_team(iVictim) )
        {
            
client_print(0print_chat"%s killed self with grenade!"name[0])
            return 
PLUGIN_HANDLED;
        } 
Make sure your module cstrike is enabled.
Why would you post that? It's going to say you grenaded yourself even if you get team kills.

The original way from CreePs is correct.
However, he should check if the killer is a valid killer before doing anything else such as getting name.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DarkT1
Member
Join Date: Oct 2011
Old 03-27-2012 , 15:19   Re: hi need code..
Reply With Quote #9

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
    
register_plugin("Request""0.1""Ex1ne")
    
register_event("DeathMsg""Event_DeathMessage""a")
}
public 
Event_DeathMessage()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
Weapon[32], name[2][32]
    
read_data(4Weaponsizeof(Weapon) -1)
    
get_user_name(iKillername[0], sizeof(name[]) -1)
    
get_user_name(iVictimname[1], sizeof(name[]) -1)
    if(
equali(Weapon"grenade"))
    {
        if( 
cs_get_user_team(iKiller) == cs_get_user_team(iVictim) )
        {
            
client_print(0print_chat"%s killed self with grenade!"name[0])
            return 
PLUGIN_HANDLED;
        }
        
client_print(0print_chat"%s killed %s with a grenade!"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equali(Weapon"knife"))
    {
        
client_print(0print_chat"%s just knifed %s"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    
    if(
iKiller == 0) {
        
client_print(0print_chat"%s commited suicide!"name[0])
    }
    return 
PLUGIN_CONTINUE

Make sure your module cstrike is enabled.
the last what u did for me thx, its not work good.
its not type the name of player suicdie,its type host name server..
"name server" commited suicide

and Exolent Right..

Last edited by DarkT1; 03-28-2012 at 08:38.
DarkT1 is offline
Old 03-28-2012, 12:22
DarkT1
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-29-2012 , 14:01   Re: hi need code..
Reply With Quote #10

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

public plugin_init() {
    
register_plugin("Request""0.1""Ex1ne")
    
register_event("DeathMsg""Event_DeathMessage""a")
}
public 
Event_DeathMessage()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    new 
Weapon[32], name[2][32]
    
read_data(4Weaponsizeof(Weapon) -1)
    
get_user_name(iKillername[0], sizeof(name[]) -1)
    
get_user_name(iVictimname[1], sizeof(name[]) -1)
    if(
equali(Weapon"grenade"))
    {
        if( 
cs_get_user_team(iKiller) == cs_get_user_team(iVictim) )
        {
            
client_print(0print_chat"%s killed his teammate %s with a grenade!"name[0], name[1])
            return 
PLUGIN_HANDLED;
        }
        if(
iKiller == iVictim) {
            
client_print(0print_chat"%s killed himself with a grenade!"name[1])
            return 
PLUGIN_HANDLED;
        }
        
client_print(0print_chat"%s killed %s with a grenade!"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equali(Weapon"knife"))
    {
        
client_print(0print_chat"%s just knifed %s"name[0], name[1])
        return 
PLUGIN_HANDLED
    
}
    
    if(
iKiller == 0) {
        
client_print(0print_chat"%s commited suicide!"name[1])
    }
    return 
PLUGIN_CONTINUE

This should normally work.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 15:12.


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