Raised This Month: $ Target: $400
 0% 

Many erroes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-12-2014 , 08:57   Re: Many erroes
Reply With Quote #1

but its some wat different it dont gives hp and only 1 sound can u plzz help ?
tousif is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 12-12-2014 , 09:24   Re: Many erroes
Reply With Quote #2

Quote:
Originally Posted by tousif View Post
but its some wat different it dont gives hp and only 1 sound can u plzz help ?
Here you go :

PHP Code:
/*
put wav file on sound/misc 

Default:cvar
amx_health_Bonus "50"
amx_frag_Bonus "2"
 */

#include <amxmodx>
#include <fun>
#include <colorchat>

#define PLUGIN "Knife Kill Bonuses"
#define VERSION "1.0"
#define AUTHOR "Flicker"

new HEALTH,FRAG;

new 
CustomSound[][] = 
    {
        
"misc/knife1.wav",
        
"misc/knife2.wav",
        
"misc/knife3.wav",
        
"misc/knife4.wav",
        
"misc/knife5.wav"
    
}
    
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//register
    
register_event("DeathMsg""onDeathMsgEvent""a")
    
    
//cvar
    
HEALTHregister_cvar("amx_health_Bonus""50");
    
FRAG=register_cvar("amx_frag_Bonus","2");
}

public 
plugin_precache()
{
    for ( new 
isizeof CustomSoundi++ )
        {
            
precache_soundCustomSound]);
        }
}  

public 
onDeathMsgEvent()
{
    new 
id read_data(1)
    
    new 
szWeapon[32]
    
read_data(4szWeaponcharsmax(szWeapon))
    
    if(
equal(szWeapon"knife") && is_user_alive(id))
    {
        new 
szName[32], szName2[32]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_name(read_data(2), szName2charsmax(szName2))
        
      
ColorChat(0,GREEN,"%s ^1Got^4 %i ^1Frags^4  %i hp ^3For Knifing^4 %s"szName,get_pcvar_num(FRAG), get_pcvar_num(HEALTH),szName2)
        
        
client_cmd0"spk %s",CustomSoundrandom_num0sizeof CustomSound ) ] );//by Arkshine
        
set_user_health(idget_user_healthid ) + get_pcvar_num(HEALTH))
        
set_user_fragsidget_user_fragsid ) + get_pcvar_num(FRAG))
    }

Not tested but it will work !!
Attached Files
File Type: sma Get Plugin or Get Source (knife_it_up.sma - 499 views - 1.6 KB)
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 12-12-2014 at 09:32.
indraraj striker 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 15:22.


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