Raised This Month: $ Target: $400
 0% 

show kill count and play kill sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 06-29-2012 , 03:04   show kill count and play kill sound
Reply With Quote #1

Hello

Kill num is displayed as "You kill"
and
Kill snd is no played

please fix to my code

best regards,

PHP Code:
#include <amxmodx>

new kill_num[32]

public 
plugin_init()
{
    
register_plugin("PLUGIN""PLUGIN""AUTHOR")

    
register_event("DeathMsg""event_death""a""1>0")
}

public 
plugin_precache()
{
    
precache_sound("amxx_sound/kill1.wav")
    
precache_sound("amxx_sound/kill2.wav")
    
precache_sound("amxx_sound/kill3.wav")
    
precache_sound("amxx_sound/kill4.wav")
    
precache_sound("amxx_sound/kill5.wav")
    
precache_sound("amxx_sound/kill6.wav")
    
precache_sound("amxx_sound/kill7.wav")
    
precache_sound("amxx_sound/kill8.wav")
    
precache_sound("amxx_sound/kill9.wav")
    
precache_sound("amxx_sound/kill10.wav")
    
precache_sound("amxx_sound/kill11.wav")
    
precache_sound("amxx_sound/kill12.wav")
    
precache_sound("amxx_sound/kill13.wav")
    
precache_sound("amxx_sound/kill14.wav")
}

public 
client_connect(id)
{
    
kill_num[id] = 0
}

public 
client_disconnect(id)
{
    
kill_num[id] = 0
}

public 
event_death()
{
        static 
iKilleriVictim
        
        iKiller 
read_data(1)
        
iVictim read_data(2)
        
        if(
iKiller != iVictim)
        {
        
kill_num[iKiller]++
        
kill_num[iVictim] = 0

        client_print
(iKillerprint_center"You %s kill"kill_num[iKiller])
        
client_cmd(iKiller"spk amxx_sound/kill%s.wav"kill_num[iKiller])
    }

RuRuRu612754 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-29-2012 , 03:14   Re: show kill count and play kill sound
Reply With Quote #2

Code:
        client_print(iKiller, print_center, "You %s kill", kill_num[iKiller]) 
        client_cmd(iKiller, "spk amxx_sound/kill%s.wav", kill_num[iKiller])

PHP Code:
        client_print(iKillerprint_center"You %d kill"kill_num[iKiller]) 
        
client_cmd(iKiller"spk ^"amxx_sound/kill%d.wav^""kill_num[iKiller]) 
%s displays a string. You want to display a decimal/int/number (%d)
You gotta put the file path within quotes.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 06-29-2012 at 03:19. Reason: PHP tags are prettiest....
Liverwiz is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 06-29-2012 , 03:26   Re: show kill count and play kill sound
Reply With Quote #3

Quote:
Originally Posted by Liverwiz View Post
Code:
        client_print(iKiller, print_center, "You %s kill", kill_num[iKiller]) 
        client_cmd(iKiller, "spk amxx_sound/kill%s.wav", kill_num[iKiller])

PHP Code:
        client_print(iKillerprint_center"You %d kill"kill_num[iKiller]) 
        
client_cmd(iKiller"spk ^"amxx_sound/kill%d.wav^""kill_num[iKiller]) 
%s displays a string. You want to display a decimal/int/number (%d)
You gotta put the file path within quotes.

I miss easy and simple
Thanks
RuRuRu612754 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-29-2012 , 03:28   Re: show kill count and play kill sound
Reply With Quote #4

Quote:
Originally Posted by RuRuRu612754 View Post

I miss easy and simple
Thanks
The simplest of things are often the ones we overlook.
You're welcome.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Reply


Thread Tools
Display Modes

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