Raised This Month: $ Target: $400
 0% 

[REQ] Knife Kill Bonus


Post New Thread Closed Thread   
 
Thread Tools Display Modes
shehzad zaidy
BANNED
Join Date: Oct 2015
Old 11-04-2015 , 03:38   Re: [REQ] Knife Kill Bonus
#51

How To Show Display Txt ??
shehzad zaidy is offline
luckyy
Junior Member
Join Date: Dec 2014
Old 11-06-2015 , 16:57   Re: [REQ] Knife Kill Bonus
#52

i also want that plugin so plz post correct code again..
luckyy is offline
Hamartia
Member
Join Date: Oct 2015
Old 12-08-2015 , 23:20   Re: [REQ] Knife Kill Bonus
#53

Hi, modified it to have random sounds and cvars to control for my requirements. Correct me if there are mistakes.

Note: The sounds are to be added by you and set their path in the array Knife_Sound. Can be changed in to a cvar if required.

PHP Code:
/* Plugin generated by AMXX-Studio */

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

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

const TASK_ID 6969;
const 
Float:DEFAULT_SPEED 250.0;

new 
Knife_Sound[7][] =
{
"sound/lovecs/knifekillbonus/baap.mp3",
"sound/lovecs/knifekillbonus/baburao.mp3",
"sound/lovecs/knifekillbonus/heybitch.mp3",
"sound/lovecs/knifekillbonus/ohfuck.mp3",
"sound/lovecs/knifekillbonus/2nife2.mp3",
"sound/lovecs/knifekillbonus/whosurdaddy.mp3",
"sound/lovecs/knifekillbonus/hurra.mp3"
};

new 
bool:g_bHasSpeed[33];

new 
amx_kkb_enableamx_kkb_hpamx_kkb_frag;

new 
Float:amx_kkb_speedFloat:amx_kkb_speed_time;

public 
plugin_init() 
{    
    
register_plugin(PLUGINVERSIONAUTHOR)        ;
    
    
amx_kkb_enable register_cvar ("amx_kkb_enable","1");
    
amx_kkb_speed register_cvar ("amx_kkb_speed","330.0");
    
amx_kkb_speed_time register_cvar ("amx_kkb_speed_time","10.0");
    
amx_kkb_hp register_cvar ("amx_kkb_hp","15");
    
amx_kkb_frag register_cvar ("amx_kkb_frag","2");
    
    
register_event("DeathMsg""onDeathMsgEvent""a");
    
register_event("CurWeapon""onCurWeaponEvent""be""1=1");
}

public 
plugin_precache(){    
    for( new 
sizeof Knife_Sound i++ ){
        
precache_genericKnife_Sound] );
    }
}

public 
onDeathMsgEvent()
{
    if(
get_pcvar_num(amx_kkb_enable)){
        
    new 
id read_data(1);
        
    new 
szWeapon[32];
    
read_data(4szWeaponcharsmax(szWeapon));
    
    if(
get_pcvar_num(amx_kkb_enable) && equal(szWeapon"knife") && is_user_alive(id))
    {
        new 
szName[32], szName2[32], randomNumber;
        
get_user_name(idszNamecharsmax(szName));
        
get_user_name(read_data(2), szName2charsmax(szName2))

        if(
get_pcvar_float(amx_kkb_speed) > DEFAULT_SPEED){
            
client_print_color(0print_chat"^4[KnifeKill] ^3%s ^1knifed ^3%s ^1& gained ^3%d ^1HP, ^3%d ^1Frags and ^3Speed"szNameszName2get_pcvar_num(amx_kkb_hp),get_pcvar_num(amx_kkb_frag));
        }else{
            
client_print_color(0print_chat"^4[KnifeKill] ^3%s ^1knifed ^3%s ^1& gained ^3%d ^1HP and ^3%d ^1Frags"szNameszName2get_pcvar_num(amx_kkb_hp),get_pcvar_num(amx_kkb_frag));
        }
                
        
randomNumber random_num(0,sizeof Knife_Sound 1);
        
client_cmd(0"mp3 play %s"Knife_Sound[randomNumber]);
        
        
set_user_health(idget_user_healthid ) + get_pcvar_num(amx_kkb_hp) );
        
        
set_user_fragsidget_user_fragsid ) + get_pcvar_num(amx_kkb_frag) );
        
        if (
get_pcvar_float(amx_kkb_speed) > DEFAULT_SPEED){
            
g_bHasSpeed[id] = true;
            
remove_task(id TASK_ID);
            
set_task(get_pcvar_float(amx_kkb_speed_time), "taskRemoveSpeed"id TASK_ID);
            
set_user_maxspeed(idget_pcvar_float(amx_kkb_speed));
        }        
    }
    }

}

public 
onCurWeaponEvent(id){
    if(
get_pcvar_num(amx_kkb_enable) && (get_pcvar_float(amx_kkb_speed) > DEFAULT_SPEED) && g_bHasSpeed[id]){
        
set_user_maxspeed(idget_pcvar_float(amx_kkb_speed));
    }
}

public 
taskRemoveSpeed(id)
{
    new 
szName[32];
    
    
id -= TASK_ID;
    
g_bHasSpeed[id] = false;
    
set_user_maxspeed(idDEFAULT_SPEED);
    
    
get_user_name(idszNamecharsmax(szName));
    
client_print_color(0print_chat"^4[KnifeKill] ^1Bonus speed removed for ^3%s"szName);

    
}

public 
client_disconnect(id)
{
    if(
get_pcvar_num(amx_kkb_enable)){
        
remove_task(id TASK_ID);
    }


Last edited by Hamartia; 02-19-2017 at 02:35.
Hamartia is offline
Old 01-27-2016, 06:05
shehzad1234
This message has been deleted by shehzad1234.
ish12321
Veteran Member
Join Date: May 2016
Old 09-05-2016 , 15:39   Re: [REQ] Knife Kill Bonus
#54

Any way to store these things in Config file

Special Requirements :
1. Cvar for amount of HP to give to user
2. Cvar for Special different HP for ViP
3. Speed increase Cvar
4. These all in a config file with also allowing to store sounds in config file
5. Random sounds are played out of all
6. Also through a cvar we can decide if we want different sounds for CT and T
7. ML Support please
ish12321 is offline
ish12321
Veteran Member
Join Date: May 2016
Old 09-06-2016 , 04:46   Re: [REQ] Knife Kill Bonus
#55

Nobody to help ?
ish12321 is offline
Old 10-26-2017, 04:16
zeeshankhan.s786
This message has been deleted by asherkin.
Closed Thread



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 19:23.


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