AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   That one killed that one (https://forums.alliedmods.net/showthread.php?t=140757)

zirualas 10-16-2010 09:49

That one killed that one
 
I wan't to do that then you kill someone it print in chat: "Name" Killed "name" but i don't know how. I only want example. ;)

Vechta 10-16-2010 10:11

Re: That one killed that one
 
DeathMsg event check the name of attacker & victim

zirualas 10-16-2010 10:23

Re: That one killed that one
 
No, i need that etc. Admin "name" gived 100hp for "name"
That's my idea.

mottzi 10-16-2010 11:45

Re: That one killed that one
 
get_user_name()

like Vechta said?

nikhilgupta345 10-16-2010 11:52

Re: That one killed that one
 
PHP Code:

public Event_DeathMsg()
{
    new 
killer read_data)
    new 
victim read_data)
    new 
headshot read_data)

    if( !
is_user_connectedkiller ) || !is_user_connectedvictim ) )
           return 
PLUGIN_HANDLED

    
new killerName[32], victimName[32]
    
get_user_namekillerkillerName31)
    
get_user_namevictimvictimName31)
       
    if( 
headshot )
    {
        
client_print0print_chat"%s killed %s with a headshot!"killerNamevictimName )
        return 
PLUGIN_HANDLED
    
}
    
    
client_print0print_chat"%s killed %s."killerNamevictimName )



zirualas 10-16-2010 12:15

Re: That one killed that one
 
It's shows for me "Counter-Strike killed Counter-Strike".

nikhilgupta345 10-16-2010 12:20

Re: That one killed that one
 
Lolwut?

Is the players's names counter-strike? :P
lol

Anyway, here's the full code, if it didn't work for you:

Code:

#include <amxmodx>

public plugin_init()
{
    register_plugin( "Show Killers", "1.0", "nikhilgupta345" )
    register_event( "DeathMsg", "Event_Deathmsg", "a" )
}

public Event_DeathMsg()
{
    new killer = read_data( 1 )
    new victim = read_data( 2 )
    new headshot = read_data( 3 )

    if( !is_user_connected( killer ) || !is_user_connected( victim ) )
          return PLUGIN_HANDLED

    new killerName[32], victimName[32]
    get_user_name( killer, killerName, 31)
    get_user_name( victim, victimName, 31)
     
    if( headshot )
    {
        client_print( 0, print_chat, "%s killed %s with a headshot!", killerName, victimName )
        return PLUGIN_HANDLED
    }
   
    client_print( 0, print_chat, "%s killed %s.", killerName, victimName )
    return PLUGIN_HANDLED
}

That should work now.

zirualas 10-16-2010 12:36

Re: That one killed that one
 
Didn't work

mottzi 10-16-2010 12:42

Re: That one killed that one
 
Then try it yourself, you now have everything you need. And you could say "Thanks" to nikhilgupta345 for his helping.

Vechta 10-16-2010 12:52

Re: That one killed that one
 
Wtf, i said the same thing to do and he said he want something other O.o


All times are GMT -4. The time now is 10:18.

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